MySQL Insertion failure.

"); } else { mysql_close(); //for testing only echo "

MySQL Insertion Successful

"; } } if ($mode == "csv") { $csv_file = 'survey.csv'; if (is_writable($csv_file)) { if (!$csv_handle = fopen($csv_file,'a')) { // this line is for troubleshooting // echo "

Cannot open file $csv_file

"; exit; } } $csv_item = "\"$q1_why\",\"$q2_services\",\"$q3_state\",\"$q4_comments\"\n"; if (is_writable($csv_file)) { if (fwrite($csv_handle, $csv_item) === FALSE) { //for testing //echo "Cannot write to file"; exit; } } fclose($csv_handle); } if ($mode == "email") { //first, define your four mail function fields $recipient = "don-duncan@comcast.net"; $subject = "Online Survey from Your Domain"; $content = "Online Survey:\n Why are you contacting us? $q1_why\n What services are you interested in? $q2_services\n Where are you from? $q3_state\n Your Comments:\n $q4_comments\n"; $header = "From: YourSurvey \n"."Reply-To: sdon-duncan@comcast.net\n"; //now send it off mail($recipient, $subject, $content, $header); } } ?> Beginner's Guide to Form Processing in PHP

Beginner's Guide to Form Processing in PHP

Joseph C Dolson

This script is the accompaniment to an article at Joe Dolson Accessible Web Design.

Thanks for submitting this form! I've processed this form with $mode!

"; } ?>

Why are you contacting us?




What service are you interested in? (Check all that apply.)




Where are you from?
Comments