Jump to content

Help what is wrong with my login script


tbobker

Recommended Posts

What is wrong with this?

Here is my login part:

[code]<html>
<body>

<div align="center">
<form method="post" action="login.php">
Username:&nbsp;<input type="text" name="username"><br>
Password:&nbsp;<input type="text" name="password"><br>
<input type="submit">
</form>
</div>

</body>
</html>[/code]


and here is the login script:

[code]<?php

include("dbconnect.inc");

$sql = "select * from login";
$result = mysql_query($sql, $conn);
$row = mysql_fetch_assoc($result);



if($_POST[username] && $_POST[password] == $row[username] && $row[password]){
include("index.php");
}
else {
echo "wrong login <a href='index.html'>Go back</a>";
}
?>[/code]

Why isnt it working? there are no errors just wont login.
Link to comment
https://forums.phpfreaks.com/topic/13776-help-what-is-wrong-with-my-login-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.