aqui les dijo el formulario en html
Cita:
Aqui el php<form id="form" method="post" action="login">
<label for="username">Username</label>
<input id="username" name="username" ><br>
<label for="password">Password</label>
<input type="password"id="password" name="password" ><br>
<input type="submit" id="submit" name="Submit" value="Login" class="green" />
</form>
<label for="username">Username</label>
<input id="username" name="username" ><br>
<label for="password">Password</label>
<input type="password"id="password" name="password" ><br>
<input type="submit" id="submit" name="Submit" value="Login" class="green" />
</form>
Código PHP:
<?php
session_start();
error_reporting(E_ALL);
//Conexion con la base
mysql_connect("localhost","root","*****");
mysql_select_db("tunerspot");
$password = md5($_POST['password']);
$username = $_POST['username'];
if(empty($username)){//checks to see if username was empty
echo ("You left user input empty");
exit;//tell the script to stop
}
if(empty($password)){//checks to see if the password was empty
echo ("You left password input empty");
exit;//we tell the whole script to stop
}
$userinfo = mysql_query("SELECT * FROM member WHERE username='$username' ");
$valid = mysql_fetch_array($userinfo);
if(empty($valid)){
echo ("This username doesn't exist in our Database");
exit;//stop the script
}
if($valid[password] == $password){
echo("Thank you for logging in ".$username."");
$_SESSION['username'] = $valid[username];
}else{
echo ("Your password for this account is invalid");
}
?>
Notice: Use of undefined constant password - assumed 'password' in C:\AppServ\www\RS\MySpot\login.php on line 30
Notice: Use of undefined constant username - assumed 'username' in C:\AppServ\www\RS\MySpot\login.php on line 33