I watched a video tutorial but it was a bit hard to see...
Soo what do i need to change in order for this to work?
And how would i set up my databases with this code? [The names of them]
[And yes i have the login forum on another html page]
Please help (DAA)
Soo what do i need to change in order for this to work?
PHP:
<?php
$connection = mysql_connect(localhost, prefix_user, password);
$db = mysql_select_db(prefix_dbname, $connection);
$sql = "SELECT id FROM user
WHERE username= ' $_POST(username)'
AND password= ' $_POST(password)' ";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if ($num > 0| )
$id = mysql_fetch_assoc($result);
setcookie ("auth", "yes", time () +6000);
setcookie ("id", $id[ 'id' ] );
setcookie ("username", $id[ 'Username' ] );
header ("Location: main.php");
}else {
header ("Location: incorrect.php");
);
?>
And how would i set up my databases with this code? [The names of them]
[And yes i have the login forum on another html page]
<html>
<head>
<title>Login Form</title>
</head>
<body>
<form name=login action=login.php method=post>
Username: <input type=text name=username>
<br>
Password: <input type=text name=username>
<br>
<input type=submit value='Login'>
</form>
</body>
</html>
Please help (DAA)