Hey guys, I wrote this script a few hours ago, and I was looking for the error, that it keeps throwing out but I cant seem to find it, any help??
[CODE]<?php
//database connection
require (dbconnect.php);
//Get input data
$fname=strip_tags($_POST[‘fullname’]);
$gid=strip_tags($_POST[‘id’]);
$wid=strip_tags($_POST[‘uname’]);
$email=strip_tags($_POST[’email’]);
$pw=strip_tags($_POST[‘pass’]);
$pilot=strip_tags($_POST[‘pilot’]);
$atc=stript_tags($_POST[‘atc’]);
$birth=strip_tags($_POST[‘birth’]);
$errorMessage = “”;
//check to make sure they are not empty
if(empty($fname)) $errorMessage .= “You did not enter your Full Name. <br/>n”;
if(empty($gid)) $errorMessage .=”You did not enter your Gamespy ID. <br/>n”;
if(empty(wid)) $errorMessage .=”You did not enter a Username. <br/>n”;
if(empty($email)) $errorMessage .=”You did not enter an E-mail address. <br/>n”;
if(empty($pw)) $errorMessage .=”You did not enter a Password. <br/>n”;
if(empty($birth)) $errorMessage .=”You did not enter a year of birth. <br/>n”;
//if there was no error, do the rest of the code
if(empty($errorMessage))
{
//get a random 8 character string.
require (randomstring.php);
$confirmationCode = getRandomString();
//add the person and confirmation code into the database
$query = “INSERT INTO ‘users’ (‘fullname’, ‘gid’, ‘uname’, ’email’, ‘birth’, ‘pass’, ‘pilot’, ‘atc’, ‘Random_Key’, ‘Active’)
VALUES (‘$fname’,’$gid’,’$wid’,’$email’,’$birth’,’$pw’,’$pilot’,’$atc’)”;
$result = mysql_query($query) OR die(mysql_error());
//now send them email
$to = “”;
$subject = “”;
$message = “”;
$headers = “”;
/* recipients */
$to = $email;
/* Subjects */
$subject = ‘Site Registration Confirmation’;
/* Message*/
$message = ‘<html>
<head>
<title> Site Registration Confirmation </title>
<body style=”font-family:verdana, arial; font-size: .8em;”>
You’re reciving this email becuase you filled out an appliaction form as a student with Chicago Aviation.
<br/><br/>
If you did not want try to register for an account, you can simply delete this email and no futher action is required.
<br/><br/>
To complete your confirmation and to add you as a student ready for training with Chicago Aviaton, please press the link below: <br/>
<a title=”Confirm Account”
href=”http://www.chicagoaviation.org/confirm.php?c=’.$confirmationCode.'”>http://www.chicagoaviation.org/confrim.php?c=’.$confirmationCode. </a>
<br/><br/>
Thank you and we hope you enjoy your training!<br/><br/>
</body>
</html>
/*To send HTML mail, set the Content-Type Header */
$headers = “MIME-Verson: 1.0rn”;
$headers .= “Content-Type: text/html; charset=iso-8859-1rn”;
/*additional Headers */
$headers .= “From: Chicago Aviation <[email protected]>rn”;
/* and now mail it */
mail($to, $subject, $message, $headers);
//whats going on
echo ‘Click the link in your email to activate your account!’;
}
else
{
echo $errorMessage;
}
?>
I think it may have something to do with this:
[CODE]//get a random 8 character string.
require (randomstring.php);
$confirmationCode = getRandomString();
but then again I don’t know!