can i put a .php include in a .html file, or do they both have to be .php... oh and i did get some success lol...
I used this to login
and it came up with - Connected successfully on my page. so thats good.(i changed UN and PWD obviously)PHP Code:$link = mysql_connect('localhost', 'USER', 'PWD');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
so i added your code.. i got this
and that dosn't work. I need some learner stickers /!\PHP Code:<?php
$link = mysql_connect('localhost', 'USER', 'PWD');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
$username = mysql_real_escape_string($_POST['username']);
$password = md5($_POST['password']);
$rs = mysql_query("SELECT * FROM `users` WHERE `uname`='{$uname}' AND `pword`='{$password}'");
if(mysql_num_rows($rs)){// one or more rows
$userInfo = mysql_fetch_assoc($rs);
$_SESSION['user'] = $userInfo['userId'];// get the users ID
echo "now logged in as {$userInfo['uname']}";
}else{// no rows
echo "Username or password incorrect.";
}
mysql_close($link);
?>

