My first piece of PHP
Thought id see if theirs any errors In it before I uploaded.
Took a while because I keep getting errors in the PHP Pad I use
PHP Code:<?php session_start(): ?>
<html>
<head />
<body>
<form action='index.php?login=yes' method=POST>
Username: <input type=text name='user'><br />
Password: <input type=password name='pass'><br />
<input type=submit value='Go!'>
</form>
<?php
$user=$_POST['user'];
$pass=$_POST['pass'];
$login=$_GET['login'];
if ($login=='yes'){
$con=mysql_connect('192.168.0.4','test',);
mysql_select_db("login");
$get=mysql_query("SELECT count(id) FROM login WHERE user='$user' AND pass='$pass");
$results=mysql_result($get, 0);
mysql_close($con);
if ($result!=1) echo "Login failure!";
else{
echo "Login success!";
$_SESSION['user']=$user;
};
};
?>
</body>
</html>





Reply With Quote



, makes me happier.


