...

View Full Version : problem with register script



sytodave88
09-05-2005, 05:16 PM
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/vhosts/globolwarfare.e2uhosting.com/test/login/register.php on line 83


line 83 is

<FORM action="<?php echo $_SERVER['PHP_SELF']; ?>" method=post>



<CENTER><BR><BR><BR><BR><IMG src="images/logo.jpg"><BR><BR><?php
require_once ('dbconnect.php');

if (isset($_POST['submit'])) {
function escape_data ($data) {
global $dbc;
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}
return mysql_real_escape_string ($data, $dbc);
}
$message = NULL;
if (empty($_POST['username'])) {
$u = FALSE;
$message .= '<br />You forgot to enter a username!';
} else {
$u = escape_data($_POST['username']);
}
if (empty($_POST['email'])) {
$e = FALSE;
$message .= '<br />You forgot to enter your email address!';
} else {
$e = escape_data($_POST['email']);
}
if (empty($_POST['password1'])) {
$p = FALSE;
$message .= '<br />You forgot to enter a password!';
} else {
$e = escape_data($_POST['email']);
}
if ($_POST['password1'] == $_POST['password2']) {
$p = escape_data($_POST['password1']);
} else {
$p = FALSE;
$message .= 'Your passwords did not match!';
}
if ($e && $u && $p) {
$result = mysql_query("SELECT * FROM user WHERE username='$u'");
if (!$row) {
$c = $_POST['cid'];
$g = $_POST['gender'];
mysql_query("INSERT INTO user (username, email, password, reg_date) VALUES ('$u', '$e', PASSWORD('$p'), NOW() )");
mysql_query("INSERT INTO online_status (username) VALUES ('$u')");
mysql_query("INSERT INTO crimes (username) VALUES ('$u')");
mysql_query("INSERT INTO gtas (username) VALUES ('$u')");
mysql_query("INSERT INTO bj_games (username) VALUES ('$u')");
mysql_query("INSERT INTO profiles (username) VALUES ('$u')");
mysql_query("INSERT INTO user_stats (username, current_city, gender) VALUES ('$u', '$c', '$g')");
$rand = mt_rand(10000,100000);
$hash = md5($rand);
$result = mysql_query("SELECT uid FROM user WHERE username='$u'");
$uid = $id[0];
mysql_query("INSERT INTO activation (username, code) VALUES ('$u','$hash')");
$message = "Welcome to GlobalWarFare, $u!
You are almost ready to start playing GlobalWarFare. All you need to do is confirm your registration by clicking on the link below:
http://globolwarfare.e2uhosting.com/test/login/activate.php?user=$u&id=$hash
Once confirmed, you can login with the information below.
Username: $u

Password: $p
Enjoy your stay at GlobalWarFare!
";
$headers = "From: GlobalWarFare <registration@underworldmafia.co.uk>\r\n";
$subject = "Welcome to GlobalWarFare";
array($e, $subject, $message, $headers);
echo "<br />";
echo '<font face="Verdana" size="-2" color="#ffffff">You have been registered.<br />Please check your email inbox for confirmation of your account<br />';
echo '<br /><a href="./index.php"><font face="Verdana" size="-2"><b>Go Back</b></font></a><br /><br /><font face="Verdana" size="-2" color="#ffffff"> Copyright 2004
exit();
} else {
$message = "That username and/or email address has already been used!";
}
}
mysql_close();
} else {
$message= ("<font face="Verdana" size="-2"><br />Please try again!</font>");
}
}
if (isset($message)) {
echo ("<center><font face="Verdana" size="-2" color="white"><b>", $message, "</b></font></center>");
}
?>
<FORM action="<?php echo $_SERVER['PHP_SELF']; ?>" method=post>
<TABLE cellSpacing=2 cellPadding=2 width="80%" align=center boarder="0">
<TBODY>
<TR vAlign=top align=middle>
<TD vAlign=top align=middle colSpan=2><FONT face=Verdana color=#ffffff
size=-2>Enter your information into the form below:</FONT></TD>
<TR vAlign=top align=middle>
<TD vAlign=center align=right><FONT face=Verdana color=#ffffff
size=-2><B>Username:</B></FONT></TD>
<TD vAlign=top align=left><INPUT
style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: black 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; BACKGROUND-IMAGE: url(images/form_bg.gif); PADDING-BOTTOM: 4px; BORDER-LEFT: black 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: Verdana"
maxLength=40
value="<?php if (isset($_POST['username'])) echo $_POST['username']; ?>"
name=username></TD></TR>
<TR vAlign=top align=middle>
<TD vAlign=center align=right><FONT face=Verdana color=#ffffff size=-2><B>Email
Address:</B></FONT></TD>
<TD vAlign=top align=left><INPUT
style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: black 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; BACKGROUND-IMAGE: url(images/form_bg.gif); PADDING-BOTTOM: 4px; BORDER-LEFT: black 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: Verdana"
maxLength=60 value="<?php if (isset($_POST['email'])) echo $_POST['email']; ?>"
name=email></TD></TR>
<TR vAlign=top align=middle>
<TD vAlign=center align=right><FONT face=Verdana color=#ffffff
size=-2><B>Password:</B></FONT></TD>
<TD vAlign=top align=left><INPUT
style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: black 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; BACKGROUND-IMAGE: url(images/form_bg.gif); PADDING-BOTTOM: 4px; BORDER-LEFT: black 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: Verdana"
type=password maxLength=40 name=password1></TD></TR>
<TR vAlign=top align=middle>
<TD vAlign=center align=right><FONT face=Verdana color=#ffffff
size=-2><B>Password (confirm):</B></FONT></TD>
<TD vAlign=top align=left><INPUT
style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: black 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; BACKGROUND-IMAGE: url(images/form_bg.gif); PADDING-BOTTOM: 4px; BORDER-LEFT: black 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: Verdana"
type=password maxLength=40 name=password2></TD></TR>
<TR vAlign=top align=middle>
<TD vAlign=center align=right><FONT face=Verdana color=#ffffff
size=-2><B>Starting City:</B></FONT></TD>
<TD vAlign=top align=left><SELECT
style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: black 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; PADDING-BOTTOM: 4px; BORDER-LEFT: black 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: Verdana"
name=cid> <OPTION value=1 selected>London - England</OPTION> <OPTION value=2>New
York - USA</OPTION> <OPTION value=3>Rome - Italy</OPTION> <OPTION value=4>Rio de
Janeiro - Brazil</OPTION> <OPTION value=5>New Delhi - India</OPTION> <OPTION
value=6>Barcelona - Spain</OPTION> <OPTION value=7>Berlin - Germany</OPTION>
<OPTION value=8>Moscow - Russia</OPTION></SELECT> </TD></TR>
<TR vAlign=top align=middle>
<TD vAlign=center align=right><FONT face=Verdana color=#ffffff
size=-2><B>Gender:</B></FONT></TD>
<TD vAlign=top align=left><SELECT
style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: black 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10px; PADDING-BOTTOM: 4px; BORDER-LEFT: black 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: Verdana"
name=gender> <OPTION value=Male selected>Male</OPTION> <OPTION
value=Female>Female</OPTION></SELECT> </TD></TR>
<TR vAlign=top align=middle>
<TD vAlign=top align=middle colSpan=2><INPUT style="BORDER-RIGHT: #c0c0c0 1px solid; BORDER-TOP: #c0c0c0 1px solid; FONT-WEIGHT: bold; FONT-SIZE: 7.5pt; BORDER-LEFT: #c0c0c0 1px solid; CURSOR: pointer; COLOR: #fefefe; BORDER-BOTTOM: #c0c0c0 1px solid; BACKGROUND-REPEAT: repeat; FONT-FAMILY: Verdana; HEIGHT: 20px; BACKGROUND-COLOR: #363636" type=submit value=Register! name=submit></TD></TR></TBODY></TABLE></FORM>The
reg email may goto your <B>Spam</B> folder if your using hotmail <BR>if you are having problems getting another
account.<BR><A href="./index.php"><FONT face=Verdana size=-2><B>Go
Back</B></FONT></A><BR><FONT face=Verdana color=#ffffff size=-2> Copyright
2004. <A href="mailto:sytodave88@gmail.com">All Rights Reserved.</A></FONT>
</CENTER>

marek_mar
09-05-2005, 05:25 PM
Look at your colored code. You forgot a ' a few lines above.

sytodave88
09-05-2005, 06:40 PM
what have a missed i am have never made a script like this so i realy need help :confused:

marek_mar
09-05-2005, 06:48 PM
The line

echo '<br /><a href="./index.php"><font face="Verdana" size="-2"><b>Go Back</b></font></a><br /><br /><font face="Verdana" size="-2" color="#ffffff"> Copyright 2004
has a missing ' and a missing ; .



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum