Problem with login page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

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

    ?>

    #2
    is your form method GET ?

    Comment


      #3
      yes it is get........................

      Comment


        #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

        Comment


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

          Comment


            #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'])){

            Comment


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

              Comment


                #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 "<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 &copy; 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 &copy; 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 &copy; 2010 All Rigths Reserved</div>";

                }else{

                $thelogin = $u;

                $sid = $unick.$mytime.$p;

                $ts = md5($sid);

                $x = "&amp;k=".$ts;

                mysql_query("update users set ts ='$ts' where username='$thelogin'");

                echo "Welcome <b>$u</b><br/>";

                echo "<a href=\"home.php?$x&amp;$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!

                Comment


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

                  Comment


                    #10
                    as they are...............

                    Comment


                      #11
                      try removing if ($_GET['spy']=='1'){ }

                      Comment


                        #12
                        and put what?

                        Comment


                          #13
                          just
                          $u = $_GET["u"];

                          $p = $_GET["p"];

                          Comment


                            #14
                            or just debug your work to find the error eg:

                            PHP Code:
                            echo "Debug: spy: $spy <br/>User: $u<br/> pass: $p <br/>Usercheck: $n[0] <br/> passcheck $s[0]"

                            Comment


                              #15
                              Originally posted by something else View Post
                              just
                              $u = $_GET["u"];

                              $p = $_GET["p"];


                              that whats there and its telling me Password is Incorrect...

                              Comment

                              Working...
                              X