is_valid) { die ("The reCAPTCHA wasn’t entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); } // ?> // mail it $mailto = 'abrogard@yahoo.com' ; $subject = "XYFord Feedback Form" ; //change below from feedback.html $formurl = "viewers.php" ; $errorurl = "error.html" ; $thankyouurl = "thankyou.html" ; $uself = 0; $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $username = $_POST['username'] ; $firstname = $_POST['firstname'] ; $email = $_POST['email'] ; $comments = $_POST['comments'] ; $secondname = $_POST['secondname'] ; $country = $_POST['country'] ; $phone = $_POST['phone'] ; //----------------------------------------------- // do write to database now--------------------------- $link = mysql_connect("localhost", "xyfordco", "mypasswed") or die("Could not connect : " . mysql_error()); // print "Connected successfully

"; $DB = "xyfordco"; $table = "clients"; mysql_select_db($DB) or die ("Database $DB not select.." . mysql_error()); // print "Successfully select the Database: $DB "; $query = "INSERT INTO $table(username,firstname,secondname,email,country,phone,comments) values('$username','$firstname','$secondname','$email','$country','$phone','$comments')"; //'max','nagpur','cdy2k2002@yahoo.co.in')"; if ( ! mysql_query( $query, $link) ) die ( "MySQL error.....

" .mysql_error() ); // print "

Successfully data added to table : $table"; //------------------------------------------------------ //-------------------------------------------- $http_referrer = getenv( "HTTP_REFERER" ); if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } //if (empty($name) || empty($email) || empty($comments)) { // header( "Location: $errorurl" ); // exit ; //} if ( ereg( "[\r\n]", $username ) || ereg( "[\r\n]", $email ) ) { header( "Location: $errorurl" ); exit ; } if (get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "UserName of sender: $username\n" . "Firstname of sender: $firstname\n" . "Secondname of sender : $secondname\n" . "Country of sender : $country\n" . "Phone number of sender: $phone\n" . "Email of sender: $email\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; mail($mailto, $subject, $messageproper, "From: \"$username\" <$email>" . $headersep . "Reply-To: \"$username\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" ); header( "Location: $thankyouurl" ); // exit ; exit ; ?>