Location: PHPKode > projects > GolfstatsPHP > golfstatsphp_3.0/signup.php
include ("header.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'";				

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


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')";

$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>
                <TD class="error">* - required field</TD>

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

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

                <TD class='menu-bg'>Email</TD>
                <TD><INPUT name=email value=<?echo $email; ?>></TD></TR>
                <TD class='menu-bg'>Contact</TD>
                <TD><INPUT name=phoneno value=<?echo $phoneno; ?>></TD></TR>
                <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