I have a user register form to create an account. When you try and hit submit, no action takes place for some reason...not even the reset button resets! I'm pretty sure the php part of it is right, maybe? I have no idea what the problem is. For a clearer understanding of my problem, go to www.verbazon.net/index.php?id=signup and try and hit submit and see what happens: NOTHING! Below is the code:
<?PHP
if(!is_null($_POST['username']) && !is_null($_POST['pass'])) {
//submit was pressed
//get user and pass variable data
$user=$_POST['username'];
$pass=$_POST['pass'];
//validation if submission
$user=strip_tags($user);
$pass=strip_tags($pass);
$user=str_replace(" ","",$user);
$pass=str_replace(" ","",$pass);
$user=str_replace("%20", "",$user);
$pass=str_replace("%20", "",$pass);
$user=addslashes($user);
$pass=addslashes($pass);
$min_length=7;
if((strlen($user) < $min_len) || (strlen($pass) < $min_len))
{
die("Your username and/or password must have a minimum of 7 characters.");
}
//user and pass entered correctly - proceed to add to database
$dbaseuser="blah";
$dbasepassword="blah";
$dbasename="blah";
$connection=mysql_connect("localhost",$dbaseuser,$dbasepassword);
$db=mysql_select_db($dbasename);
$pass=md5($pass);
$request="INSERT INTO login values(0, '".$user.",'".$pass."')";
$results=mysql_query($request, $connection);
if($results)
{ echo "Your account has successfully been created";
}
else
{
echo "There was an error creating your account. Please retry or contact the webmaster.";
echo"<a href='www.verbazon.net/index.php?id=signup'>Go back</a>";
mysql_error();
exit;
}}
?>
<html>
<link href="text.css" rel="stylesheet" type="text/css">
<div align="center" class="text">
<p>Insert a desired username and password in the fields below.</p>
<table width="200" border="0" cellspacing="2" cellpadding="0">
<tr>
<td class="text">Username:</td>
<td><form name="form1" method="post" action="<?php echo $_SERVER['php_self'] ?>">
<input name="username" type="text" class="text" id="username">
</form></td>
</tr>
<tr>
<td class="text">Password:</td>
<td><input name="pass" type="text" class="text" id="pass">
</td>
</tr>
<tr>
<td colspan="2"><div align="center" class="text">
<input name="Submit" type="submit" class="text" value="Submit">
<input name="Reset" type="reset" class="text" value="Reset">
</div></td>
</tr>
</table>
</div>
</html>