Jump to content

$end error


marcus

Recommended Posts

[tt]Parse error: syntax error, unexpected $end in /home/neoblob/public_html/cms/register.php on line 139[/tt]


[code]
<?php include('header.php'); ?>
<?php
$action = $_POST[action];
$act = $_GET[action];
$username = $_POST[username];
$bday1 = $_POST[year];
$bday2 = $_POST[day];
$bday3 = $_POST[month];
$userpass = $_POST[password];
$passconf = $_POST[passconf];
$email = $_POST[email];
$emailconf = $_POST[emailconf];
$userip = $_SERVER[REMOTE_ADDR];
$ref = $_GET[ref];
$ref2 = $_POST[ref2];
$formact = "register.php";
$formeth = post;

if($ref){
$sql = "SELECT id,username FROM users WHERE id=$ref";
$result = mysql_query($sql);
$result2 = mysql_fetch_assoc($result);
$referrer = $result2[username];
$refid = $result2[id];
};

if(!$ref){
$ref = "0";
};

if(!$act){
echo "Hello! Looks like you want to register for NBCMS. Well just hit register below and get started!!<br><br><a href='?action=register'>Register</a>";
};

if($act == register){
echo "
<h3>Register</h3>
<table border=0 cellspacing=0 cellpadding=2>
<form name=register action=".$formact." method=".$formeth.">
<input type=hidden name=action value=doreg>
<tr><td>
Username:<td colspan=3><input type=text name=username>
<tr><td>
Password:<td colspan=3><input type=password name=password>
<tr><td>
Confirm:<td colspan=3><input type=password name=passconf>
<tr><td>
Email:<td colspan=3><input type=text name=email>
<tr><td>
Confirm:<td colspan=3><input type=text name=emailconf>
<tr><td>
Birthday:<td>
<select name=month>
<option value=January>January
<option value=February>February
<option value=March>March
<option value=April>April
<option value=May>May
<option value=June>June
<option value=July>July
<option value=August>August
<option value=September>September
<option value=October>October
<option value=November>November
<option value=December>December
</select><td>
<select name=day>";
?>
<?php
for($i=1; $i<32; $i++){
echo "<option value=$i>$i</option>";
};
?>
<?php
echo "
</select>
<td>
<select name=year>";
?>
<?php
for($i=1900; $i<1993; $i++){
echo "<option value=$i>$i</option>";
};
?>
<?php
echo"
</select>
<tr><td>
Age:<td>
<select name=age>";
?>
<?php
for($i=13; $i<107; $i++){
echo "<option value=$i>$i</option>";
};
?>
<?php
echo "
</select>";
if($ref){
echo "<tr><td>Referrer<td>$referrer<input type=text name=ref2 value=$refid>";
};
echo "
<tr><td colspan=2>
<input type=submit value=Submit> <input type=reset value=Reset>
</form>
</table>";
};


if($action == doreg){

if(!$username || !$email || !$passconf || !$userpass || !$emailconf){
echo "Please fill in all the missing fields";
};

$sqlcun = "SELECT username,email,ip FROM users WHERE username=$username,email=$email,IP=$userip";
$rescun = mysql_query($sqlcun);
$numcun = mysql_num_rows($rescun);

if($userpass != $passconf){
echo "Your passwords did not match";
};

if($email != $emailconf){
echo "Your emails did not match";
};

if($numcun > 0){
echo "The username, email or IP is already in use!";
};

if($username && $email && $passconf && $userpass && $emailconf){
$addus = "INSERT INTO `users` (`username` , `pass` , `email` , `IP` , `age` , `bday_year` , `bday_month` , `bday_day` , `referred` )VALUES ('$username', '$userpass', '$email', '$userip', '$age', '$bday1', '$bday3', '$bday2', '$ref2');
$resus = mysql_query($addus);
};
};
?>
[/code]

cant figure it out :/
Link to comment
https://forums.phpfreaks.com/topic/27650-end-error/
Share on other sites

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.