Problem with login page
Collapse
X
-
have you md5 your passwords? or are you logging them in database as they are?
Leave a comment:
-
here is my form page called login.php
<!-- LOGIN.PHP -->
<?php
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
echo "<head>";
echo "<meta name=\"keywords\" content=\"chat,free,pics,photos,videos,myspace\"/>";
echo "<meta name=\"description\" content=\"Login to Chillblock.\"/>";
echo "<title>Chillblock | Login</title>";
echo "<link href=\"css/122538344.css\" rel=\"stylesheet\" type=\"text/css\" />";
echo "</head>";
echo "<body>";
echo "<h3>Login</h3>";
echo "<form action=\"ucheck.php\" method=\"GET\">";
echo "<p>";
echo "<b>Username</b>:<br/>";
echo "<input name=\"u\" type=\"text\" size=\"15\" maxlength=\"20\"/><br/>";
echo "<b>Password</b>:<br/>";
echo "<input name=\"p\" type=\"text\" size=\"15\" maxlength=\"20\"/><br/>";
echo "<input name=\"spy\" type=\"hidden\" value=\"1\"/>";
echo "<input type=\"submit\" class=\"submitter\" value=\"Login\"/><br/>";
echo "</p>";
echo "</form>";
echo "<p>";
echo "<a href=\"signup.php\">Need an Account [?]</a><br/>";
echo "<a href=\"forget.php?ac=pass\">Forget your Password [?]</a>";
echo "</p>";
echo "<div class=\"copy\">";
echo "Chillblock © 2010 All Rigths Reserved";
echo "</div>";
echo "</body>";
echo "</html>";
?>
and the other page that shows whether the stuffs are right or wrong
<!-- UCHECK.PHP -->
<?php
include("x.php");
include("876con.php");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
echo "<head>";
echo "<meta name=\"keywords\" content=\"chat,free,pics,photos,videos,myspace\"/>";
echo "<meta name=\"description\" content=\"Mobile community where you can meet people, chat, share pics and videos and play games on your cell phone.\"/>";
echo "<title>Chillblock | Meet People</title>";
echo "<link href=\"css/122538344.css\" rel=\"stylesheet\" type=\"text/css\" />";
echo "</head>";
echo "<body>";
if ($_GET['spy']=='1')
{
$u = $_GET["u"];
$p = $_GET["p"];
}
echo "<p>";
$n = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE username='".$u."'"));
if($n[0]==0)
{
echo "<div class=\"error\">Username is Incorrect</div><a href=\"login.php\">Try Again</a><div class=\"copy\">Chillblock © 2010 All Rigths Reserved</div>";
$s = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE username='".$u."' AND password='".$p."'"));
}else{
if($s[0]==0)
{
echo "<div class=\"error\">Password is Incorrect</div><a href=\"login.php\">Try Again</a><div class=\"copy\">Chillblock © 2010 All Rigths Reserved</div>";
}else{
$thelogin = $u;
$sid = $unick.$mytime.$p;
$ts = md5($sid);
$x = "&k=".$ts;
mysql_query("update users set ts ='$ts' where username='$thelogin'");
echo "Welcome <b>$u</b><br/>";
echo "<a href=\"home.php?$x&$u\">Continue...</a><br/>";
}
}
echo "</p>";
echo "</body>";
echo "</html>";
?>
tell me if you see the error there please cause all am getting it username is incorrect and password is incorrect!
Leave a comment:
-
yeah i did that but i do not like it that and all of a sudden it starts giving me problems again
Leave a comment:
-
only way u can use auto login is with a link with &sumbit=1 in the link because of the if(isset($_GET['submit'])){
Leave a comment:
-
i am using a auto login thats why am using GET but its ok now it works...found the bug
Leave a comment:
-
Personally i would use form method as POST seeming you are not using an auto-login page
there must be something wrong with your form fields
Leave a comment:
-
Problem with login page
i dont know whats wrong it keeps saying username is incorrect thats all
<?php
include("75657.php");
include("connect45.php");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
echo "<head>";
echo "<meta name=\"keywords\" content=\"chat,free,pics,photos,videos,myspace\"/>";
echo "<meta name=\"description\" content=\"Mobile community where you can meet people, chat, share pics and videos and play games on your cell phone.\"/>";
echo "<title>Chillblock | Meet People</title>";
echo "<link href=\"css/122538344.css\" rel=\"stylesheet\" type=\"text/css\" />";
echo "</head>";
echo "<body>";
echo "<p style=\"text-align: center\">";
if(isset($_GET['submit'])){
$un = $_GET["un"];
$up = $_GET["up"];
}
$n = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE username='".$un."'"));
if($n[0]==0)
{
echo "<div class=\"errormsg\">Username is Incorrect</div><a href=\"login.php\">Try Again</a><br/>";
}
$p = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE username='".$un."' AND password='".$up."'"));
if($p[0]==0)
{
echo "<div class=\"errormsg\">Password is Incorrect</div><a href=\"login.php\">Try Again</a><br/>";
}else{
//if success get link below
echo "<a href=\"home.php\">[enter]</a><br/>";
}
echo "</body>";
echo "</html>";
?>Tags: None
Leave a comment: