First of all, the error I'm getting is: Parse error: parse error, unexpected $ in /home/httpd/vhosts/dinstitute.com/httpdocs/signup.phtml on line 191
Now when I past the file into HydraPHP I don't even have a line 191, so I can't even help narrow it down to a specific area. but here is the file and if anyone could help I'd appreciate it.
<?
include "functions.phtml";
if ($action == "signup") {
#Checking if user is ip banned
$number = mysql_count("banned_ips WHERE ip='$REMOTE_ADDR'");
if ($number) message("Log in", "You have been banned from this site !");
# RESERVED ARRAY
$reserved = array("webmaster","hiddenbeauxbatons","rpgteam","support","rpg","anonymous",
"staff","staffs","info","request","question","faq","admin","thestaff","staffs",
"hogwarts","store","hexstaff","hexstaffs","harry","harrypotter","hermione");
$user = trim($user);
$email = trim($email);
$password = "pass".rand(100,999);
$encrypt = iencrypt($password);
# VALIDATION : $user
if ($user == "") $error[1] = "Your username is required.";
elseif (strlen($user) > 20 || strlen($user) < 3) $error[1] = "Your username must be within 3 to 20 characters.";
elseif (eregi_replace("[A-Za-z0-9_]","",$user) != "") $error[1] = "Your username contains invalid characters.";
elseif (mysql_count("users WHERE username='$user'")) $error[1] = "Username '$user' is taken by other user. Please choose another. Thanks.";
elseif (in_array(strtolower($user),$reserved)) $error[1] = "Sorry, this username is reserved. Please choose another. Thanks.";
if (!$agree) $error[100] = "You must agree to the terms and conditions to sign up here.";
# VALIDATION : $firstname, $lastname
if ($firstname == "" || $lastname == "") $error[2] = "Your first name and last name are required.";
# VALIDATION : $email
if ($email == "") $error[3] = "Your email is required.";
elseif (eregi("^([a-z]|[0-9]|\.|-|_)+@([a-z]|[0-9]|\.|-|_)+\.([a-z]|[0-9]){2,3}$",$email)
and !eregi("(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)",$email) ) {} else $error[3] = "Email address is invalid.";
# VALIDATION : $dob
if ($day && $month && $year) $dob = "$year$month$day";
if ($dob && !checkdate($month,$day,$year)) $error[4] = "Date of birth is invalid ... are you an alien from other planet ? :)";
elseif (!$dob) $error[4] = "Your date of birth is required.";
# VALIDATION : $gender, $location
if ($gender == "") $error[5] = "Your gender is required.";
if ($location == "") $error[6] = "Your location is required.";
if (is_array($error)) {
foreach ($error as $each) $message .= "$each<br>";
message("Sign Up",$message,1);
} else {
mysql_query("INSERT INTO users SET username='$user',password='$encrypt',firstname='$firstname',lastname='$lastname',email='$email',location='$location',dob='$dob',
gender='$gender',point='0',hunger='$time',thirst='$time',wand='',broom='',galleon='80',sickle='0',knut='0',lastlogin='$time',started='$time'");
mysql_query("INSERT INTO users_info SET username='$user',house='New Member',year='1',postcount='0',signature='',preference='',group_id='1'");
mysql_query("INSERT INTO users_profile SET username='$user',profile='$profile'");
sendmail($email,"Welcome to Durmstrang Institute","Hello $firstname,
Welcome to Durmstrang Institute
Your account details are as follows :
Username : $user
Password : $password
Best wishes,
The Administration Team at Durmstrang Institute
");
header("location:/signup.phtml?action=done&firstname=$firstname");
exit;
}
if ($action == "done") {
include "header.phtml";
?>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="9" height="9"><img src="/pics/mtopleft.gif" width="9" height="9"></td>
<td background="/pics/mtop.gif" width="100%" height="9"><img src="/pics/spacer.gif" width="452" height="1"></td>
<td width="9" height="9"><img src="/pics/mtopright.gif" width="9" height="9"></td>
</tr>
<tr>
<td background="/pics/mleft.gif" width="9"><br></td>
<td bgcolor="#010E1F" class="size12"> <div align="right" class="content_head">Thank you and Welcome</div>
<div class="size12"><br>
<b>To <?=$firstname ?>,</b><p>
Your account has been created.<br>
An email has been sent which contains your login information.<br>
You should receive it within 5 minutes.<br>
Click on login on the right navigation bar to login to your account.<br>
Once again, thanks to join us and have fun at DIN<p>
<b>- Durmstrang Administration Staff</b><p>
</div>
</td>
<td background="/pics/mright.gif" width="9"><br></td>
</tr>
<tr>
<td width="9" height="9"><img src="/pics/mfootleft.gif" width="9" height="9"></td>
<td background="/pics/mfoot.gif" height="9"><img src="/pics/spacer.gif" width="452" height="1"></td>
<td width="9" height="9"><img src="/pics/mfootright.gif" width="9" height="9"></td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
</table>
<?
include "footer.phtml";
exit;
}
?>
<?
include "header.phtml";
include "dateform.phtml";
$dateform = dateform();
$dateform = "$dateform[d] $dateform[m] $dateform[y]";
?>
<form action="signup.phtml" method="post">
<input type=hidden name=action value="signup">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="9" height="9"><img src="/pics/mtopleft.gif" width="9" height="9"></td>
<td background="/pics/mtop.gif" width="100%" height="9"><img src="/pics/spacer.gif" width="452" height="1"></td>
<td width="9" height="9"><img src="/pics/mtopright.gif" width="9" height="9"></td>
</tr>
<tr>
<td background="/pics/mleft.gif" width="9"><br></td>
<td bgcolor="#010E1F" class="size12"> <div align="right" class="content_head">Sign Up</div>
<div class="size12"><br>
Username :
<input name=user size=20 maxlength=20 style="width:160px;" class="textfield">
A-Z,a-z,0-9_<br>3-20 characters<br>
<font size=2>First Name :</font>
<input name=firstname size=20 maxlength=25 style="width:160px;" class="textfield"><br>
<font size=2>Last Name :</font>
<input name=lastname size=20 maxlength=25 style="width:160px;" class="textfield">
<br><font size=2>Email :</font>
<input name=email size=20 maxlength=50 style="width:160px;" class="textfield">
Please enter a valid email address. We will send the password to your email address above.
<br>
Date of birth :</font>
<?=$dateform ?>
<br>
<font size=2>Gender :</font>
<select name="gender" style="width:160px;" class="textfield"><option value="">Select ...<option value=M>Male<option value=F>Female</select>
<br>
<font size=2>Location :</font>
<input name=location size=20 maxlength=50 style="width:160px;" class="textfield">
<font size=2>Profile :</font><br>
<textarea name=profile style="width:300px;" rows=5 class="textfield"></textarea><br>
<input type=checkbox name=agree> I agree to the <a href="terms.phtml">terms and conditions</a><br>
<input type=submit value=" Submit " class="textfield"> <input type=reset value=" Reset " class="textfield">
</div>
</td>
<td background="/pics/mright.gif" width="9"><br></td>
</tr>
<tr>
<td width="9" height="9"><img src="/pics/mfootleft.gif" width="9" height="9"></td>
<td background="/pics/mfoot.gif" height="9"><img src="/pics/spacer.gif" width="452" height="1"></td>
<td width="9" height="9"><img src="/pics/mfootright.gif" width="9" height="9"></td>
</tr>
</table>
</form>
<?php
include "footer.phtml";
?>
<div align="center"></div>