Modernvox Posted February 22, 2010 Share Posted February 22, 2010 Form set up properly, Database in correct order. First here's the notice: This is the only error/notice received Notice: Use of undefined constant confirmclass - assumed 'confirmclass' in /home/a7250761/public_html/process.php on line 127 // Although this is not my main concern it still exists. The problem occurs when I attempt to send the user a confirmation link by email. For some reason nothing is going into the database so here's the code <?php include('configclass.php'); error_reporting(E_ALL); ini_set("display_errors", 1); // table name $confirmclass= confirmclass; // Random confirmation code $confirm_code=md5(uniqid(rand())); // values sent from form $location= $_POST['location']; $actual_location= $_POST['actual_location']; $title= $_POST['title']; $details= $_POST['details']; $email= $_POST['email']; if ($title == "" || strlen($title >50)) { echo "<font face= \"tahoma\" color= \"red\" size= \"2\">1-50 characters allowed</font>"; exit(); } if ($details == "" || strlen($details >350)) { echo "<font face= \"tahoma\" color= \"red\" size= \"2\">Ad must be between 1 and 350</font>"; exit(); } $pattern = '/^[a-z0-9]{4,}+.?([a-z0-9]+)?@([a-z0-9]+\.)+[a-z]{3,4}$/i'; if (!preg_match($pattern, $email)) { echo "<font face= \"tahoma\" color= \"red\" size= \"2\">sorry, email is not valid</font>"; exit(); } $pattern = '/^[a-z0-9]{4,}+.?([a-z0-9]+)?@([gmail]+\.)+[a-z]{3,4}$/i';//exclude Gmail here if (preg_match($pattern, $email)) { echo "<font face= \"tahoma\" color= \"red\" size= \"2\">Sorry, Gmail accounts are not allowed</font>"; exit(); } // Insert data into database $sql="INSERT INTO $confirmclass (confirm_code, location, actual_location, title, details, email)VALUES('$confirm_code', '$location', '$actual_location', '$title', '$details' '$email')"; $result=mysql_query($sql); if($result){ $to = $email; $subject = " Activate your AD on I WANNA JAM!"; $message = "Verify your AD by clicking the following link:\rhttp://www.mysite.com/confirmation.php?$confirm_code\r\rRegards, I WANNA JAM!.com Team"; $headers = 'From: noreply@ IWANNAJAM.com' . "\r\n" . 'Reply-To: noreply@ IWANNAJAM.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); } // if not found else { echo "We did not find your email in our database"; } // if your email succesfully sent if($email){ echo "Your Confirmation link Has Been Sent To Your Email Address."; } else { echo "Cannot send Confirmation link to your e-mail address"; } ?> Link to comment https://forums.phpfreaks.com/topic/192877-attempting-to-troubleshoot-email-verification-script/ Share on other sites More sharing options...
Modernvox Posted February 22, 2010 Author Share Posted February 22, 2010 Yep...No matter what I try I get We did not find your email in our databaseYour Confirmation link Has Been Sent To Your Email Address. What gives man??? Link to comment https://forums.phpfreaks.com/topic/192877-attempting-to-troubleshoot-email-verification-script/#findComment-1015906 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.