here's my php so far and there is two errors from when i put the session code in..
any help or tips or advice or anything would be helpful thank you.
Code: Select all
<?php
session_start();
$name = $_POST['name'];
// Register session key with the value
$_SESSION['name'] = $name;
if ($submit)
{
$db = mysql_pconnect('localhost) or die ("Could not connect to database");
mysql_select_db('models') or die ("Could not select database!");
$sql = "select * from usser where name = '$username'";
$result = mysql_query($sql, $db) or die ("Execution failed.");
while ($row=mysql_fetch_array($result))
{
if ($row["password"]==$password)
{
echo " ('Successfully Logged In!<a href='index.php'>Click Here</a>') ";
}
else
{
echo "wrong password";
}
}
}
?><html>
<form method=post action="<?echo $PHP_SELF?>">
<table cellpadding=2 cellspacing=0 border=0>
<td>Username:</td><td><input type="text" name="username" size=10></td><tr>
<td>Password:</td><td><input type="password" name="password" size=10></td><tr>
<td> </td><td><input type="submit" name="submit" value="Log In"></td>
</table></form>
</html>