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.
Shopping cart using PHP Sessions, MySQL In this tutorial, you are going to learn how to build a simple shopping cart project using PHP and MySQL. It is a basic project aimed for beginners . This project uses PHP Session to implement shopping cart. Within the session, a cart is created. Sessions allows you managing the products in the cart. Such as… adding product to the cart, modifying the product quantity, deleting the product finding the total number of products in the cart. etc. Download source code from the given link: Note: Scan the code with antivirus and use it. Download Here are steps to accomplish the project. Just follow them. STEP-1 Create a project in a server. Create an image's folder inside the project folder. As given in the picture. Copy some sample products images in that. GO TOP↑ STEP-2: Start server. Open PhpMyAdmin tool in a browser, Create a database, with name shoppingcartdb. Create Table. And insert Data using the given queri...
Learn How to Import CSV File into MySQL Database Using PHP This article shows you how to import an uploaded CSV file into MySQL using PHP. index.php file having a form code to upload a CSV file. Once the file uploaded successfully, PHP opens it and reads the line from CSV. Each line of data separated into php variables and then inserted into MySQL table. This process continues until the last line of the CSV. Once it is finished inserting, It displays a message – " Data Inserted in database" And finally closes CSV file. In case any error in uploading, it shows "the file type not allowed" message. PHP Version 5.5.11 1. Create a table with given code in a Database. Query: CREATE TABLE IF NOT EXISTS `items` ( `id` int ( 11 ) NOT NULL AUTO_INCREMENT , `title` varchar ( 100 ) DEFAULT NULL , `description` varchar ( 100 ) DEFAULT NULL , PRIMARY KEY ( `id` ) ) ; 2. Create a following file with you database details and include it in a index.ph...
How to Export Data to Excel using PHP and MySQL This tutorial demonstrates you how to export MySQL table data to Excel spreadsheet, when a user clicks a button on a webpage. You can achieve this using PHP, MySQL. For this, create the files specified in the below, in some folder in Apache server. php2excel-tbl .php export.php Now run the first file in the web server. When button clicked, export.php will be executed at backend and generates the Excel file. php2excel-tbl.php <?php /*******EDIT DB Details *******/ $DB_Server = "localhost" ; //MySQL Server $DB_Username = "root" ; //MySQL Username $DB_Password = "" ; //MySQL Password $DB_DBName = "usersdb" ; //MySQL Database Name $DB_TBLName = "users" ; //MySQL Table Name $filename = "excel-users-list" ; //File Name /*******YOU DO NOT NEED TO EDIT ANYTHING BELOW THIS LINE*******/ //create MySQL connection...
Comments
Post a Comment