Jump to content

Attempting to Troubleshoot Email Verification Script...


Modernvox

Recommended Posts

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";
}

?>






Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.