
March 25th, 2004, 04:47 PM
|
|
Contributing User
|
|
Join Date: Apr 2007
Posts: 121
Time spent in forums: 28 m 39 sec
Reputation Power: 2
|
|
|
log-in script problem
iv got the following as a registeration script(there is more after but its not relevant)
php Code:
Original
- php Code |
|
|
|
<? include("../connect.php"); /** * Returns true if the username has been taken * by another user, false otherwise. */ function usernameTaken($username){ } $q = "select username from users where username = '$username'"; } /** * Inserts the given (username, password) pair * into the database. Returns true on success, * false otherwise. */ function addNewUser($username, $password, $email){ $q = "INSERT INTO users VALUES ('$username', '$password', '$email')"; } /** * Displays the appropriate message to the user * after the registration attempt. It displays a * success or failure status depending on a * session variable set during registration. */ function displayStatus(){ $uname = $_SESSION['reguname']; if($_SESSION['regresult']){ ?> Thank you <b><? echo $uname; ?></b>, your information has been added to the database, you may now <a href= "index.php" title= "Login"><b>log in</b></a>. <? } else{ ?> We're sorry, but an error has occurred and your registration for the username <b><? echo $uname; ?></b>, could not be completed.<br> Please try again at a later time. <? } unset($_SESSION['reguname']); unset($_SESSION['registered']); unset($_SESSION['regresult']); } if(isset($_SESSION['registered'])){ /** * This is the page that will be displayed after the * registration has been attempted. */ ?>
im getting the 'error has occured' message everytime i try and register someone for the site
i have managed to register 2 people in the past but it wont let me register anyone else
anyone have any clues why?
|