Jump to content


Photo

Help


  • Please log in to reply
9 replies to this topic

#1 reecieboy

reecieboy
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 09 April 2006 - 01:10 PM

hey can someone please help me debug the following:
[a href=\"http://pastebin.com/649448\" target=\"_blank\"]http://pastebin.com/649448[/a]

anyhelp is highly appreciated

#2 theone

theone
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 09 April 2006 - 01:26 PM

well lets start with basic html. tahoma is not a font family its merely a font face. a family consists of more than one.
but you need to be more specific as to what is not working or what errors its spitting out.
theone

#3 reecieboy

reecieboy
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 09 April 2006 - 01:44 PM

[!--quoteo(post=362974:date=Apr 9 2006, 08:26 AM:name=theone)--][div class=\'quotetop\']QUOTE(theone @ Apr 9 2006, 08:26 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
well lets start with basic html. tahoma is not a font family its merely a font face. a family consists of more than one.
but you need to be more specific as to what is not working or what errors its spitting out.
[/quote]


ok fair enough lol. umm [a href=\"http://203.87.72.141/login.php\" target=\"_blank\"]http://203.87.72.141/login.php[/a] mysql fetch array is not a valid resource.. and cheers for this :D

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 09 April 2006 - 01:46 PM

You do realize that you posted your root password for the world to see when you posted your code?

Ken

#5 reecieboy

reecieboy
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 09 April 2006 - 01:48 PM

thanks for pointing that out, fixed

#6 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 09 April 2006 - 01:51 PM

Use multiple lines for you query so debugging is easier:
<?php
$q = "SELECT * FROM users WHERE userid='". $_POST['username']. "' AND passid='".$_POST['password'] . "'";
$rs = mysql_query($q) or die('Problem with query: ' . $q . '<br />' . mysql_error());
$qquery = mysql_fetch_array($rs);
?>

Ken

#7 reecieboy

reecieboy
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 09 April 2006 - 01:54 PM

thanks hold up ill try that

#8 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 09 April 2006 - 01:59 PM

BTW, here's your code modified to use CSS instead of embedded styles:
<html>
<head>
<title>PWN|CLAN - Login</title>
<style>
body {
    background-color: Black;
    color: White;
    font-family: Tahoma, sans-serif;
    font-size: 100%;
}
#userpass {
    width: 60px;
    border-color:#777777;
    background-color: #FFFFFF;
    color: #000000;
}

#subm {
    border-color: #777777;
    background-color: #FFFFFF;
    color: #000000;
}
</style>
</head>
<body>

<?php
if (!isset($_POST['submit']) || (isset($_POST['submit']) && $_POST['username'] == '') || (isset($_POST['submit']) && $_POST['password'] == '')) {
        echo "<form name='zlogin' method='POST' action='" . $_SERVER['PHP_SELF'] . "'>";
        echo "Username:&nbsp;&nbsp;<input type='text' name='username' id='userpass'><br>";
        echo "Password:&nbsp;&nbsp;<input type='password' name='password' id='userpass'><br>";
        echo "<input type='submit' name='submit' value='Login' id='subm'>&nbsp;<input type='reset' name='reset' value='Reset' id='subm'>";
        echo "</form>";
    }else {
        mysql_connect("localhost", "***", "***") OR die('password');
        mysql_select_db("main") OR die('Connecting');

        $q = "SELECT * FROM users WHERE userid='". $_POST['username']. "' AND passid='".$_POST['password'] . "'";
        $rs = mysql_query($q) or die('Problem with query: ' . $q . '<br />' . mysql_error());
      $qquery = mysql_fetch_array($rs);
        if ($qquery['username'] == $_POST['username'] && $qquery['password'] == $_POST['password']) {
            session_name('login');
            session_start();
            
            $_SESSION['username'] = $_POST['username'];
            $_SESSION['password'] = $_POST['password'];
            
            echo $fontfamily."Successfully logged in as: ".$_POST['username']."<br><a href='index.php?page=your_account'>Click here to continue...</a></font>";
        }else {
            echo $fontfamily."Login failed,<br><a href='index.php?page=login'>Click here to try again...</a></font>";
    }
            
            


}
?>
</body>
</html>

Ken

#9 reecieboy

reecieboy
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 09 April 2006 - 01:59 PM

thank you, it now works :D

#10 SomeGuy1337

SomeGuy1337
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 09 April 2006 - 03:43 PM

be sure to use the CSS very important to move away from that horrible html sytles, u will learn that the hard way if you dont learn it now.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users