cody4camp Posted January 2, 2010 Posted January 2, 2010 <? require('dblogon.php'); if(isset($HTTP_POST_VARS['usern'])) { $username = strip_tags($HTTP_POST_VARS['usern']); $password = strip_tags($HTTP_POST_VARS['passw']); $usern = mysql_real_escape_string(trim($username)); $passw = mysql_real_escape_string(trim($password)); setcookie("Username",$usern); setcookie("Password",$passw); setcookie("Check", "0"); $_SESSION["check"]=0; header("Location: member.php"); exit(); } require('std_l.php'); ?> <center> <table border="0" cellpadding="2px" cellspacing="0" width="300px"> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <? if(isset($_GET['forget']) && $_GET['forget']==1) { echo "<tr><td>Email address</td><td><input type=\"text\" name=\"email\" maxlength=\"200\" class=\"sdinp\"></td></tr>\n"; echo "<tr><td></td><td><input type=\"submit\" value=\"Recover\" class=\"sdbut\"></td></tr>\n"; } else if(isset($_POST['email'])) { $email = mysql_real_escape_string(trim($_POST['email'])); $result = mysql_query("SELECT email,username,password FROM userinf WHERE email='".$_POST['email']."' ", $db); if(mysql_num_rows($result)) { $retval = mysql_fetch_array($result); $msg = "Your account information is as follows:\n \n"; $msg.= "Username: ".$retval['username']."\n"; $msg.= "Password: ".$retval['password']."\n"; mail($retval['email'],$title.": Account info",$msg,"From: $title"); echo "<tr><td align=\"center\">[b]Your account information has been emailed to you![/b]</td></tr>\n"; } else { echo "<tr><td align=\"center\">[b]Account not found![/b]</td></tr>\n"; } } else { echo "<tr><td>Username</td><td><input type=\"text\" name=\"usern\" maxlength=\"50\" class=\"sdinp\"></td></tr>\n"; echo "<tr><td>Password</td><td><input type=\"password\" name=\"passw\" maxlength=\"50\" class=\"sdinp\"></td></tr>\n"; echo "<tr><td></td><td><input type=\"submit\" value=\"Log me in\" class=\"sdbut\"></td></tr>\n"; echo "<tr><td colspan=\"2\"></td></tr>\n"; echo "<tr><td colspan=\"2\" align=\"center\"><a href=\"login.php?forget=1\">[ forgotten password? ]</a></td></tr>\n"; } ?> </form> </table> </center> <? require('std_r.php'); ?> I'm at my wits end. i click submit and nothing happens. Quote
Guest cablebox Posted January 2, 2010 Posted January 2, 2010 You can always do something like mccodes, you make a file called authentication, or something, put all the login data in there. Then in your login.php or whatever, put a login form leading to your authentication file. I think it is much easier Quote
cody4camp Posted January 3, 2010 Author Posted January 3, 2010 Thanks for trying, but that really didnt help me at all. Quote
Zeggy Posted January 4, 2010 Posted January 4, 2010 Try replacing $HTTP_POST_VARS with $_POST instead. It's deprecated in PHP 5. Also... don't store username/password in cookies. Quote
cody4camp Posted January 5, 2010 Author Posted January 5, 2010 im going to have the cookie encrypted Quote
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.