Site icon Cody Paste

Save Data to Excel/CSV Instead of MySQL

If you want to save ‘Form’ data or any other data to ‘Excel/CSV’, you are on the right blog.

Here we will save Form Data to a ‘CSV’ File instead of any Database, we are going to use PHP for this.

(We are assuming you have knowledge of PHP)

So let’s get started.

 

STEP 1:

Create a CSV File ‘contact_data.csv‘. (Open Ms Excel and save a file in CSV Format)

Write the column name in the first row of the ‘contact_data.csv’.

(Here we are writing “sr_no”,”name”,”email”,”subject”,”message” )

 

STEP 2:

Create a simple HTML Form index.html with action ‘post.php’, Code given below

 

STEP 3:

Create Action File ‘post.php‘, Code given below.

 

DOWNLOAD CODE

Exit mobile version