Okay, this is really weird for me to be asking for assistance when it comes to coding, but alas I actually need some help please.
I am currently working with some scripts of mine and all of a sudden they stop working for no reason what-so-ever. No forms will submit to the database at all and its really starting to tick me off to be honest.
Here is the coding for my registration and you will see what I mean.
if anyone could help me at all please it would be greatful
.
I am currently working with some scripts of mine and all of a sudden they stop working for no reason what-so-ever. No forms will submit to the database at all and its really starting to tick me off to be honest.
Here is the coding for my registration and you will see what I mean.
PHP:
<?
include "functions.php";
if ($action == "signup") {
# RESERVED ARRAY
$reserved = array("nabakza","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 = rand(100000000,999999999);
$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 : $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.";
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',email='$email',lastlogin='$time',started='$time'");
sendmail($email,"Welcome to Hidden Beauxbatons !!!","Hiya $firstname,
Welcome to Hidden Beauxbatons. The best Harry Potter role playing site on the internet.
Your account details are as follows :
Username : $user
Password : $password
Have fun !
Best wishes,
Hidden Beauxbatons Team");
header("location:/signup.php?action=done");
exit;
}
}
if ($action == "done") {
include "header.php";
?>
<font size=2>
<b>Hidden Beauxbatons - Sign Up</b><p>
<style type="text/css">
.textfield { font-family: Verdana; font-size: 10px; color: black; border: 1px #FFCC00 solid; background-color: white;}
</style>
<table border=0 cellpadding=0 cellspacing=1>
<tr><td>
<table border=0 cellpadding=2 cellspacing=1 width=450>
<tr bgcolor>
<td>
<font size=2><br>
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>
Login on the right navigation bar enter your account.<br>
<b>- Hidden Beauxbatons</b><p>
</font>
</td>
</tr>
</table>
</td></tr>
</table>
<?
include "footer.php";
exit;
}
include "header.php";
?>
<font size=2>
<b>Hidden Beauxbatons - Sign Up</b><p>
<font size=1>
* Please read the terms and conditions before signing up. Thanks ^_^ !<p>
</font>
<form action="signup.php" method="post">
<input type=hidden name=action value="signup">
<table border=0 cellpadding=0 cellspacing=1>
<tr><td>
<table border=0 cellpadding=2 cellspacing=1 width=450>
<tr
<td colspan=3><font size=2><b>Account Information</b></font></td>
</tr>
<tr>
<td colspan=3> </td>
</tr>
<tr>
<td width=100><font size=2>Username :</font></td>
<td width=200><input name=user size=20 maxlength=20 style="width:160px;" class="textfield"></td>
<td width=150>A-Z,a-z,0-9_<br>3-20 characters</td>
</tr>
<tr>
<td width=100><font size=2>Email :</font></td>
<td width=200><input name=email size=20 maxlength=50 style="width:160px;" class="textfield"></td>
<td width=150> </td>
</tr>
<tr>
<td width=100> </td>
<td colspan=2>Please enter a valid email address. If you don't have an email address, you
can sign up for one at <a href="http://mail.yahoo.com" target=_blank>Yahoo</a> or <a href="http://www.hotmail.com" target=_blank>Hotmail</a>. We will send the password to your email address above.</td>
</tr>
<tr>
<td colspan=3> </td>
</tr>
<tr>
<td> </td><td colspan=2><input type=checkbox name=agree> I agree to the <a href="terms.phtml">terms and conditions</a></td>
</tr>
<tr>
<td colspan=3 align=center><input type=submit value=" Submit " class="textfield"> <input type=reset value=" Reset " class="textfield"></td>
</tr>
</table>
</td></tr>
</table>
</form>
<?
include "footer.php";
?>
if anyone could help me at all please it would be greatful