1
|
<?php/* Written by Gerben Schmidt, http://scripts.zomp.nl */include_once("config.php");include('session.php');include("../language/$language");checkLoggedIn("no");$title="Member Registration Page";if($_POST["submit"]){ field_validator("login name", $_POST["login"], "alphanumeric", 4, 15); field_validator("password", $_POST["password"], "string", 4, 15); field_validator("confirmation password", $_POST["password2"], "string", 4, 15); if(strcmp($_POST["password"], $_POST["password2"])) { $messages[]="Your passwords did not match"; } $query="SELECT login FROM $table_users WHERE login='".$_POST["login"]."'"; $result=mysql_query($query, $link) or die("MySQL query $query failed. Error if any: ".mysql_error()); if( ($row=mysql_fetch_array($result)) ){ $messages[]="Login ID \"".$_POST["login"]."\" already exists. Try another."; } if(empty($messages)) { newUser($_POST["login"], $_POST["password"]); cleanMemberSession($_POST["login"], $_POST["password"]); header("Location: members.php?".session_name()."=".session_id()); }}?><html><head><title><?php print $title ?></title><?php doCSS()?><body><h1><?php print $title?></h1><?phpif(!empty($messages)){ displayErrors($messages);}?><form action="<?=$_SERVER["PHP_SELF"]?>" method="POST"> <table> <tr> <td>Login:</td> <td><input type="text" name="login" value="<?php print $_POST["login"] ?>" maxlength="15"></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" value="" maxlength="15"></td> </tr> <tr> <td>Confirm password:</td> <td><input type="password" name="password2" value="" maxlength="15"></td> </tr> <tr> <td> </td> <td><input name="submit" type="submit" value="Submit"></td> </tr> </table></form><?php include('footer.php'); ?></body></html>
|