Código PHP:
<?php
session_start() ;
$link = mysql_connect("localhost","root","lucho");
mysql_select_db("practico",$link);
if( isset($_POST['ingresar']) && $_POST['ingresar'] == "Ingresar" ){
$sql ="select * from usuarios where usuario='".$_POST['usuario']."' and clave='". $_POST['clave']."'";
$result = mysql_query($sql,$link);
if($result){
$_SESSION['usuario'] = $_POST['usuario'];
header("Location: loginok.php");
}else{
header("Location: loginerror.php");
}
mysql_close($link);
