Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-19-2005, 07:22 AM
tommeh
Unregistered

Posts: n/a

login help

this is my script:
[code:1:e45362f94f]
<?

if (isset($_POST['login'])) {

$username = $_POST["user"];
$password = $_POST["pass"];

mysql_connect("localhost", "user", "pass") or die( "Unable to connect to database");
@mysql_select_db("db") or die( "Unable to select database");

$query="SELECT * FROM users WHERE user='$username' AND pass = '$password'";
$result=mysql_query($query);

$username = $row['username'];
$password = $row['password'];
$id = $row['id'];

if (mysql_num_rows==0) {
echo ("The database contains no record of your user or your password is incorrect.");
} else {
setcookie("XingName", "$username");
setcookie("XingID", "$id");
mysql_close();
echo("<meta http-equiv=\"refresh\" content=\"0;URL=./?p=\">");
echo("Hello there $user");

}} else {

echo("<form name=\"login\" action=\"\" method=\"post\">");
echo("<p>");
echo("<input name=\"user\" type=\"text\" id=\"user\">");
echo("</p>");
echo("<p>");
echo("<input name=\"pass\" type=\"password\" id=\"pass\" value=\"\">");
echo("</p>");
echo("<p>");
echo("<input type=\"submit\" name=\"login\" value=\"Submit\">");
echo("<input type=\"reset\" name=\"Reset\" value=\"Reset\">");
echo("</p>");
echo("</form>");

}

?>
[/code:1:e45362f94f]
it doesnt work though for some strange reason, anyone help?
Reply With Quote
  #2  
Old 03-21-2005, 09:46 PM
PHP-Largo
Unregistered

Posts: n/a

your going $row['this']; but u need to run a while(){} loop ... :s
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Login fattybomb Tech Support 3 06-29-2009 06:29 PM
i Cant login on DFB mohamedRashid Delta Force 9 10-28-2008 11:34 AM
LOGIN! atholon Feedback / Novahq.net Support 2 04-11-2004 06:17 PM
Can't login JoJo Tech Support 0 04-21-2003 04:24 AM
login name XenoMorpH Feedback / Novahq.net Support 2 09-12-2002 05:12 AM


All times are GMT -5. The time now is 06:15 AM.




Powered by vBulletin®