ted_chou12 Posted December 29, 2006 Share Posted December 29, 2006 [code]<?phpob_start();session_start();require_once ("functions.php");$returnurl = urlencode(isset($_GET["returnurl"])?$_GET["returnurl"]:"");if($returnurl == "") $returnurl = urlencode(isset($_POST["returnurl"])?$_POST["returnurl"]:"");$do = isset($_GET["do"])?$_GET["do"]:"";$do = strtolower($do);switch($do){case "": if (checkLoggedin()) {include("usernav.php");?> <h3>User Logged In</h3> <p>This is the members only area.</p><?php } else {?> <a name="User Panel"></a> <h1>User Panel</h1> <h3>User Login</h3> <form name="login" action="login.php?do=login" method="POST" onsubmit="return aValidator();"> <input type="hidden" name="returnurl" value="<?$returnurl?>"> <table cellPadding=3 width=225 border=1> <tr> <td colSpan=2> <center> <p><b>Members-Only Area!</b></font></p> </center></td></tr> <tr> <td align=center width=70>Username:</td> <td><input type="text" name="username"></td></tr> <tr> <td align=center width=70>Password:</td> <td><input type="password" name="password"></font></td></tr> <tr> <td align=middle colspan=2> <input type="submit" name="submit" value="Login"></td></tr> <td align=middle colSpan=2> <input type="checkbox" name="remme" value="on"> Remember me for the next time I visit</td> </form></table></td> <?php } break;case "login": $username = isset($_POST["username"])?$_POST["username"]:""; $password = isset($_POST["password"])?$_POST["password"]:""; if ($username=="" or $password=="" ) { echo "<h1>Username or password is blank</h1>";//this does not show when the input(s) are blank clearsessionscookies(); header("location: index.php?returnurl=$returnurl"); } else { if(confirmuser($username,$password)) { createsessions($username,$password); if ($returnurl<>"") header("location: $returnurl"); else { header("Location: index.php"); } } else { echo "<h1>Invalid Username and/Or password</h1>";//this message does not show when the user login invalid clearsessionscookies(); header("location: index.php?returnurl=$returnurl"); } } break;case "logout": clearsessionscookies(); header("location: index.php"); break;}?>[/code]What maybe the case, could anyone help me with this?Thanks Ted. Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted December 30, 2006 Author Share Posted December 30, 2006 Can anyone help me with this please? Quote Link to comment Share on other sites More sharing options...
bfmv91 Posted April 28, 2012 Share Posted April 28, 2012 Hi I was using the same code and also facing the same problem could you please tell me how you solved it? Quote Link to comment Share on other sites More sharing options...
bfmv91 Posted April 29, 2012 Share Posted April 29, 2012 Common guys please anyone help me :'( Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.