Parse error: syntax error, unexpected $end in /www/zxq.net/c/o/o/coolismine/htdocs/register/index.php on line 106
I don't know what the problem is, but I know one thing for sure: the php is getting mixed up with the html. I'll post my code below if you think you can figure it out:
CODE
<HTML>
<HEAD><TITLE>Register to Claim Your COOL!!!</TITLE></HEAD>
<BODY bgcolor=red>
<IMG SRC="coolismine.jpg">
Please fill out the form below:
<?php
include "functions.php"
?>
<center>
<form method="POST" action="register/index.php">
<table border="0" style="text-align: left; border: 1px solid black; padding: 2px; font-family: Tahoma; font-size: 12px;">
<tr>
<td>
Username:
</td>
<td>
<input type="text" name="username" value="<?php echo $_POST['username']; ?>">
</td>
<td>
Password:
</td>
<td>
<input type="password" name="password" value="<?php echo $_POST['password']; ?>">
</td>
<td>
<p>E-mail
</td>
<td>
<p><input type="text" name="email">
</td>
<td>
<p><input type="submit" name="submit" value="submit">
</td>
</tr>
</table>
</form>
<?php if($_POST['submit']) { ?>
<table border="0" style="width: 250; margin-top: 5px; border: 2px solid black; padding: 2px orange; font-family: Tahoma; font-size: 48px">
<?php
$curnum = 0;
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
if(!username) {
$curnum ++;
echo "<tr><td>".$curnum.". Please fill in your desired username.</td></tr>";
}
if(!password) {
$curnum ++;
echo "<tr><td>".$curnum.". Please fill in your desired password.</td></tr>";
}
if(!email) {
$curnum ++;
echo "<tr><td>".$curnum.". Please fill in your E-mail address.</td></tr>";
}
if($username) {
if(strlen($username) > 30) {
$curnum ++;
echo "<tr><td>".$curnum.". Your username is too long. Please shorten it down to only 30 characters or less.</td></tr>";
}
if(strlen($username) < 3) {
$curnum ++;
echo "<tr><td>".$curnum.". Your username is too short. Please lengthen it to at least 3 characters.</td></tr>";
}
if($password) {
if(strlen($password) > 30) {
$curnum ++;
echo "<tr><td>".$curnum.". Your password is too long. Please shorten it down to only 30 characters or less.</td></tr>";
}
if(strlen($password) < 5) {
$curnum ++;
echo "<tr><td>".$curnum.". Your password is too short. Please lengthen it to at least 3 characters.</td></tr>";
}
$sql = "SELECT * FROM myMembers WHERE username='".$username."'";
$res = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($res) > 0) {
$scurnum ++;
echo "<tr><td>".$curnum.". The username '<b>".$username."<b>' already exists. Please enter a different username.</td></tr>";
if($curnum == 0) {
mysql_query("INSERT INTO myMembers VALUES(`id`,'".$username."','".$password."','".$email."'):) or die(mysql_error());
} ?>
</table><?php } ?>
</center>
</BODY>
</HTML>
<HEAD><TITLE>Register to Claim Your COOL!!!</TITLE></HEAD>
<BODY bgcolor=red>
<IMG SRC="coolismine.jpg">
Please fill out the form below:
<?php
include "functions.php"
?>
<center>
<form method="POST" action="register/index.php">
<table border="0" style="text-align: left; border: 1px solid black; padding: 2px; font-family: Tahoma; font-size: 12px;">
<tr>
<td>
Username:
</td>
<td>
<input type="text" name="username" value="<?php echo $_POST['username']; ?>">
</td>
<td>
Password:
</td>
<td>
<input type="password" name="password" value="<?php echo $_POST['password']; ?>">
</td>
<td>
<p>E-mail
</td>
<td>
<p><input type="text" name="email">
</td>
<td>
<p><input type="submit" name="submit" value="submit">
</td>
</tr>
</table>
</form>
<?php if($_POST['submit']) { ?>
<table border="0" style="width: 250; margin-top: 5px; border: 2px solid black; padding: 2px orange; font-family: Tahoma; font-size: 48px">
<?php
$curnum = 0;
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
if(!username) {
$curnum ++;
echo "<tr><td>".$curnum.". Please fill in your desired username.</td></tr>";
}
if(!password) {
$curnum ++;
echo "<tr><td>".$curnum.". Please fill in your desired password.</td></tr>";
}
if(!email) {
$curnum ++;
echo "<tr><td>".$curnum.". Please fill in your E-mail address.</td></tr>";
}
if($username) {
if(strlen($username) > 30) {
$curnum ++;
echo "<tr><td>".$curnum.". Your username is too long. Please shorten it down to only 30 characters or less.</td></tr>";
}
if(strlen($username) < 3) {
$curnum ++;
echo "<tr><td>".$curnum.". Your username is too short. Please lengthen it to at least 3 characters.</td></tr>";
}
if($password) {
if(strlen($password) > 30) {
$curnum ++;
echo "<tr><td>".$curnum.". Your password is too long. Please shorten it down to only 30 characters or less.</td></tr>";
}
if(strlen($password) < 5) {
$curnum ++;
echo "<tr><td>".$curnum.". Your password is too short. Please lengthen it to at least 3 characters.</td></tr>";
}
$sql = "SELECT * FROM myMembers WHERE username='".$username."'";
$res = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($res) > 0) {
$scurnum ++;
echo "<tr><td>".$curnum.". The username '<b>".$username."<b>' already exists. Please enter a different username.</td></tr>";
if($curnum == 0) {
mysql_query("INSERT INTO myMembers VALUES(`id`,'".$username."','".$password."','".$email."'):) or die(mysql_error());
} ?>
</table><?php } ?>
</center>
</BODY>
</HTML>
All help is greatly appreciated! I will thank you in advance!
