The purpose of this blogging site to provide coding tutorials, notes,coding tips, MCQs and code examples. You will find tutorials on various IT technologies. This site main goal is helping beginners to become developers. These programming tutorials teach you how to program, and improve coding skills. You will find tutorials on various programming languages. It may help you to shape up your coding ability. Find simple and straight forward coding techniques. Keep visiting..
Uploading Multiple Files in PHP
Get link
Facebook
X
Pinterest
Email
Other Apps
How to Upload multiple files and store in a folder and array
Sometimes we need to upload more than one file at a time. This tutorial helps you how to upload many files and store them in a folder and get their names stored in the PHP array. In this example, there are two files. Create a folder in the server and copy the files given below. Open index.php and check the result.
index.php
upload.php
index.php : Contains front-end code(form for uploading files) and allows user to upload more than one file at a time. User selects multiple files, and clicks on submit button.
upload.php: will receives the files and stores them in a folder and also in an array. Next, using for loop, it prints the names of the uploaded files and the preview of the images.
Open PDF in Bootstrap Modal Window This tutorial shows How to pass a JavaScript/jQuery variable to bootstrap modal view and sets it to iframe src attribute. It passes value dynamically to src attribute of the iframe. When the user clicks a link, it opens the URL in a popup window. This code shows the PDF in a Model without download option by hiding the toolbar. To show PDF toolbar in modal, just add #toolbar=1 in the above script. index.php <!DOCTYPE html> <html lang= "en" > <head> <title>Bootstrap Model with PDF Example - coding-zon</title> <meta charset= "utf-8" > <meta name= "viewport" content= "width=device-width, initial-scale=1" > <link rel= "stylesheet" href= "https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" > <script src= "https://cdn.jsdelivr.net/npm/jquery@3.6.1/dist/jquery.slim.
Merging two PDFs in PHP What is PDF? The Portable Document Format. PDF stands for "Portable Document Format". Essentially, the format is used when you need to save files that cannot be modified but still need to be easily shared and printed. PDF is one of the most commonly used file types around. PDFs generally contain shareable data, such as text or photo documents etc., and are accessible to anyone who has a computer or smartphone. Unlike a Word file, which requires Microsoft Word to view or edit, most browsers will open a PDF. How to merge PDFs? You can merge several documents into one. In PHP, you have a library called TCPDF which allows you to combine one or more PDF documents to one single document. In this article, we will create a new PDF by Merging PDF documents using TCPDF. Download the PDFMerger-tcpdf.zip here. Unzip it and copy it to the PHP server. Copy the PDF files into the same folder that you want to combine. Open the file: merge-pdf-example.php Provide
Upload Excel file and Import it into MySQL in PHP Create a table in some database with given code. Download Library - extract it, rename the folder to library . Create index.php file with given code in a server. Create excelUpload.php with given code. Create db_config.php . Create one Excel file with some sample data as shown in the below image of Excel file. Create ' uploads ' folder in the same directory. Now start server, run the index.php. Upload a .xls file. If Everything is fine, Excel data inserted in the above created MySQL table - tbl_products . PHP Version: 5.5.11 Folder Structure Query: CREATE TABLE IF NOT EXISTS `tbl_products` ( `id` int ( 11 ) NOT NULL AUTO_INCREMENT, `productname` varchar ( 100 ) DEFAULT NULL , `description` varchar ( 100 ) DEFAULT NULL , PRIMARY KEY (`id`) ) Top index.php <!DOCTYPE html> <html> <head> <title> coding-zon Demo - Upload Excel to MySQL in PHP </title> <lin
Comments
Post a Comment