Php - Contact Form To Download File And Save Info In Database?Aug 24, 2012
To keep it simple this is what im trying to acheive.
user fills in the form
fields are validated if filled properly
when form submitted, check for all validation, if not then show error, if yes
email form details to my email
store same details into mysql database
show thank you message
download pdf file from within the folder
I've managed to do all of that but im facing one issue. when user click on download button without filling anything, they get an error but an empty row is added to the database. If they fill incorrect form they still see an error, but now there are 2 rows in the database. AND if they fill everything correctly, they see thanks you message and also get to download the file but it still add 2 rows in the table.
here is code for index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL]">