Location: PHPKode > projects > GolfstatsPHP > golfstatsphp_3.0/signup.php
<?
include("dbasecon.inc.php");
include("userfunctions.inc.php");
include ("header.php");
include_once("sf.php");


if ($HTTP_POST_VARS['Submit']) {
//we have to check to see if there is already an entry.
$userchecksql="Select a1.login
				from users_tour a1
					where a1.login = '$reqlogin'";				
				$usercheckquery=mysql_query($userchecksql);
				$usercheckexist=mysql_numrows($usercheckquery);

				
if ($usercheckexist) {
$error="User login already exist. Please enter a unique user login.";
} else {

//checkpasswords

if ($reqpassword <> $reqpassword2) {

$error="Your passwords don't match.";

} else {
 $useraddsql = "Insert into users_tour
	 						(userid,name,surname,password,login,handicap,age,homeclub,email,phoneno) VALUES 
	 						('$reqlogin', '$reqname', '$reqsurname','$reqpassword', '$reqlogin', '$handicap', '$age','$homeclub','$email', '$phoneno')";
			$useraddresult=mysql_query($useraddsql);

$success=1;
$error= "You are now signed up. <a href='login.php'>Login</a> and enjoy!";			

} //endif password

} //endif usercheck exist

}//endif submit





?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<? showheader("Sign up"); ?>

<? echo "<p><font class='error'>$error</font>"; ?>

<?
if ((!$HTTP_POST_VARS['submit']) && ($success<>1)) {

?>
      <FORM action="<?=$PHP_SELF ?>" method="post" onSubmit="return checkrequired(this)">
            <TABLE border=0 cellPadding=1 cellSpacing=1>
              <TBODY>
              <TR>
                <TD class="error">* - required field</TD>
                <TD>&nbsp;</TD></TR>
              <TR>

              <TR>
                <TD class='menu-bg'>First Name *</TD>
                <TD><INPUT name=reqname value=<?echo $reqname; ?>></TD></TR>
              <TR>
                <TD class='menu-bg'>Surname *</TD>
                <TD><INPUT name=reqsurname value=<?echo $reqsurname; ?>></TD></TR>
              <TR>
                <TD class='menu-bg'>Age</TD>
                <TD><INPUT name=age value=<?echo $age; ?>></TD></TR>


              <TR>
                <TD class='menu-bg'>Username *</TD>
                <TD><INPUT name="reqlogin" value="<?echo $reqlogin; ?>" maxlength="15"></TD></TR>
              <TR>
                <TD class='menu-bg'>Password *</TD>
                <TD><INPUT name=reqpassword value=<?echo $reqpassword; ?>></TD></TR>
              <TR>
                <TD class='menu-bg'>Confirm Password *</TD>
                <TD><INPUT name=reqpassword2 value=<?echo $reqpassword2; ?>></TD></TR>
              <TR>
                <TD class='menu-bg'>Home Club</TD>
                <TD><INPUT name=homeclub value=<?echo $homeclub; ?>></TD></TR>
              <TR>
                <TD class='menu-bg'>Handicap</TD>
                <TD><SELECT name=handicap>
									<? 
									if (!$handicap) {
									$handicap2 = 18;
									} else {
									$handicap2=$handicap;
									}
									$listdayz2 = listdigits2("38", "$handicap2");
									echo "$listdayz2";
									?>	

								</select></TD></TR>              
							<TR>
                <TD class='menu-bg'>Email</TD>
                <TD><INPUT name=email value=<?echo $email; ?>></TD></TR>
              <TR>
                <TD class='menu-bg'>Contact</TD>
                <TD><INPUT name=phoneno value=<?echo $phoneno; ?>></TD></TR>
              <TR>
                <TD>&nbsp;</TD>
                <TD><INPUT name=Submit type=submit value=Submit></TD></TR></TBODY></TABLE></FORM>&nbsp;</TD></TR></TBODY></TABLE></TD></TR>
								


<?
} //end if success <> 1
?>
<? showfooter(); ?>
Return current item: GolfstatsPHP