Problem with login page

Started on the old forum in June 2010 · view the original in the archive · old links redirect here

24 replies · 1,025 views · started 16 years ago · 1 min read

3 participants
wap_king Developer · 126 posts #1

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 " ";

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 "Username is Incorrect<a href="login.php">Try Again</a> ";

}

$p = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE username='".$un."' AND password='".$up."'"));

if($p[0]==0)

{

echo "Password is Incorrect<a href="login.php">Try Again</a> ";

}else{

//if success get link below

echo "<a href="home.php">[enter]</a> ";

} echo "</body>";

echo "</html>";

?>

wap_king Developer · 126 posts #3

yes it is get........................

something else Fellow · 2,296 posts #4

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

wap_king Developer · 126 posts #5

i am using a auto login thats why am using GET but its ok now it works...found the bug

something else Fellow · 2,296 posts #6

only way u can use auto login is with a link with &sumbit=1 in the link because of the if(isset($_GET['submit'])){ 🙂

wap_king Developer · 126 posts #7

yeah i did that but i do not like it that and all of a sudden it starts giving me problems again

wap_king Developer · 126 posts #8

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 " ";

echo "Username: ";

echo "<input name="u" type="text" size="15" maxlength="20"/> ";

echo "Password: ";

echo "<input name="p" type="text" size="15" maxlength="20"/> ";

echo "<input name="spy" type="hidden" value="1"/>";

echo "<input type="submit" class="submitter" value="Login"/> ";

echo " ";

echo "</form>";

echo " ";

echo "<a href="signup.php">Need an Account [?]</a> ";

echo "<a href="forget.php?ac=pass">Forget your Password [?]</a>";

echo " ";

echo "";

echo "Chillblock © 2010 All Rigths Reserved";

echo "";

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 " ";

$n = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE username='".$u."'"));

if($n[0]==0)

{

echo "Username is Incorrect<a href="login.php">Try Again</a>Chillblock © 2010 All Rigths Reserved";

$s = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE username='".$u."' AND password='".$p."'"));

}else{

if($s[0]==0)

{

echo "Password is Incorrect<a href="login.php">Try Again</a>Chillblock © 2010 All Rigths Reserved";

}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 $u ";

echo "<a href="home.php?$x&$u">Continue...</a> ";

} } echo " ";

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!

something else Fellow · 2,296 posts #9

have you md5 your passwords? or are you logging them in database as they are?

wap_king Developer · 126 posts #10

as they are...............

something else Fellow · 2,296 posts #14

or just debug your work to find the error eg:

echo "Debug: spy: $spy <br/>User: $u<br/> pass: $p <br/>Usercheck: $n[0] <br/> passcheck $s[0]"; 
wap_king Developer · 126 posts #16

that was the first thing that was there actually

something else Fellow · 2,296 posts #17

what does the debug line say ? if it comes back something like: Debug: spy: 1 User: something_else pass: random Usercheck: passcheck

then you know there is a problem with your sql

wap_king Developer · 126 posts #18

nothing wrong with sql...try sumting else and it worked so ama figure out whats wrong and fix it......

wap_king Developer · 126 posts #19

hey i got it recode the page and got it now i need sid how do i do that?

Ponick Developer · 216 posts #20
 if ($_GET["spy"]=="1")
{
$u = $_GET["u"];

$p = $_GET["p"];
}
/* I don't know everything hehe */

Find me on facebook

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close