I am extremly sorry to even contemplate somone making head and foot of my coding. However I have searched and searched for my error and I simply cant find it I recive the error
Parse error: parse error, unexpected $end in join3.php on line 290
Note: 290 is my last line. Im taking im missing a curly brace somewhere. However on my web server running PHP 4.3 I belive I recive no errors but I dont get and Email. But if I use it on my local host I get the error above.
If you realy want my source here you go!
ANY HELP AT ALL IS GREATLY APRICIATED
Thankyou Jamie x
<?php
require_once('dbc.php');
unset($sentmail);
$username = $_POST['username'] ;
$email = $_POST['email'] ;
$password = $_POST['password'] ;
$firstname = $_POST['first_name'] ;
$lastname = $_POST['last_name'] ;
$info = $_POST['info'] ;
$username = stripslashes($username);
$email = stripslashes($email);
$firstname = stripslashes($firstname);
$lastname = stripslashes($lastname);
$info = stripslashes($info);
$password = stripslashes($password);
$encpassword = md5($password);
$pending_sql_email_check = mysql_query("SELECT email_address FROM emailmember WHERE email_address='$email'");
$pending_sql_username_check = mysql_query("SELECT username FROM emailmember WHERE username='$username'");
$pending_email_check = mysql_num_rows($pending_sql_email_check);
$pending_username_check = mysql_num_rows($pending_sql_username_check);
//Existing
$ex_sql_email_check = mysql_query("SELECT email_address FROM users WHERE email_address='$email'");
$ex_sql_username_check = mysql_query("SELECT username FROM users WHERE username='$username'");
$ex_email_check = mysql_num_rows($ex_sql_email_check);
$ex_username_check = mysql_num_rows($ex_sql_username_check);
// End of vars
if (isset ($_POST['submit']) && strlen($username) >0 && strlen($email) >0 && eregi(".+@.+\..+",$email) && strlen($password) >5 && $pending_email_check <1 && $pending_username_check <1 && $ex_username_check <1 && $ex_email_check <1 && strlen($firstname) >0 && strlen($lastname) >0) {
/* Email Form */
$confirm_code=md5(uniqid(rand()));
$sql="INSERT INTO emailmember (confirm_code, username, email_address, password, first_name, last_name, info)VALUES('$confirm_code', '$username', '$email', '$encpassword', '$firstname', '$lastname', '$info')";
$result=mysql_query($sql);
if($result){
// ---------------- SEND MAIL FORM ----------------
$subject="Your confirmation link here";
$header="from: Craig-M <jamiethompson90@hotmail.com>";
$message="Thank you for regestering at http://www.craig-m.co.uk \r\n";
$message.="Below you will find a link to confirm your e-mail adress, \r\n";
$message.="once you have clicked on the link you will recive futher instructions on how to finish your account details. \r\n";
$message.="If you did not request this account just egnor this e-mail, you will not be e-mailed again unless you activate your account. \r\n";
$message.="http://www.craig-m.co.uk/confirm.php?confirmemailcode=$confirm_code";
$sentmail = mail($email,$subject,$message,$header);
}
else {
die ('Database error: ' . mysql_error());
};
if($sentmail){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
font-weight: bold;
}
body {
background-color: #CCCC33;
}
</style>
</head>
<body>
<?php
echo($email);
echo($subject);
echo($message);
echo($header);
?>
Congratulations, You have successfully created your account. To activate your account you must first vertify your e-mail address.<br />
You should recive an email within the next few mins.<br />
In your email you will find instructions on activating your account.
</body>
</html>
<?php
}
else { ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
font-weight: bold;
}
body {
background-color: #CCCC33;
}
</style>
</head>
<body>
SERVER ERROR!
</body>
</html>
<?
/* End of Email Form */
}; }
//Reset
elseif (isset ($_POST['submit'])) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
font-weight: bold;
}
body {
background-color: #CCCC33;
}
.red{color: #FF0000;}
<?php
if (isset ($_POST['submit'])) {
if (empty ($_POST['username'])) {echo (".username{color: #FF0000;}\n");}
elseif ($pending_username_check > 0) {echo (".username{color: #FF0000;}\n");}
elseif ($ex_username_check > 0) {echo (".username{color: #FF0000;}\n");};
if (empty ($_POST['password'])) {echo (".password{color: #FF0000;}\n");}
elseif (strlen($_POST['password']) < 6) {echo (".password{color: #FF0000;}\n");}
if (empty ($_POST['email'])) {echo (".email{color: #FF0000;}\n");}
elseif (!eregi(".+@.+\..+",$_POST['email'])) {echo (".email{color: #FF0000;}\n");}
elseif ($pending_email_check > 0) {echo (".email{color: #FF0000;}\n");}
elseif ($ex_email_check > 0) {echo (".email{color: #FF0000;}\n");};
if (empty($_POST['first_name'])) {echo (".firstname{color: #FF0000;}\n");};
if (empty($_POST['last_name'])) {echo (".lastname {color: #FF0000;}\n");};
};
?>
</style>
</head>
<body>
<p><span class="red">Fields marked in red are unnaceptable.</span><br />
Your username will be an easy way to identify who you are we recomend you use something appropreate. <br />
You must provide a valid e-mail as you will be authenticated using this.<br />
You also must provide a password with a lenght greater than 6 charicters. </br>
<?php if($pending_email_check > 0){
echo "<span class=\"red\"><strong>The email address supplied is allready awaiting aproval!</strong></span><br />";
} ;
if($pending_username_check > 0){
echo "<span class=\"red\"><strong>The username supplied is allready awaiting aproval!</strong></span><br />";
} ;
if($ex_email_check > 0){
echo "<span class=\"red\"><strong>The email address supplied belongs to an existing member!</strong></span><br />";
} ;
if($ex_username_check > 0){
echo "<span class=\"red\"><strong>The username supplied belongs to an existing member!</strong></span><br />";
} ;
?>
<form method="post" action="<?php echo ($_SERVER['PHP_SELF']); /* Set target self */?>">
<tr>
<table width="22%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="85%"><strong>Sign up</strong></td>
<td width="15%"> </td>
</tr>
<tr>
<td><span class="username">Username</span></td>
<td><input name="username" type="text" id="username" size="30" value="<?php echo ($_POST['username']); ?>" /></td>
</tr>
<tr>
<td><span class="email">E-mail</span></td>
<td><input name="email" type="text" id="email" size="30" value="<?php echo ($_POST['email']); ?>" /></td>
</tr>
<tr>
<td><span class="password">Password</span></td>
<td><input name="password" type="password" id="password" size="30" /></td>
</tr>
<tr>
<td><span class="firstname">Firstname</span></td>
<td><input name="first_name" type="text" id="first_name" size="30" value="<?php echo ($_POST['first_name']); ?>" /></td>
</tr>
<tr>
<td><span class="lastname">Lastname</span></td>
<td><input name="last_name" type="text" id="last_name" size="30" value="<?php echo ($_POST['last_name']); ?>" /></td>
</tr>
<tr>
<td>Information</td>
<td>
<textarea name="info" cols="80" rows="10" id="info"><?php echo ($_POST['info']); ?></textarea>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value="Submit" />
<input type="reset" name="Reset" value="Reset" /></td>
</tr>
</table>
</form>
</body>
</html>
<?php };
//Reset
if (!isset ($_POST['submit'])) {
?>