Aqui dejo el codigo de la pagina de logue.
Código:
Ojala me puedan ayudar.<?php require_once('Connections/Vehiculos.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['user'])) { $loginUsername=$_POST['user']; $password=$_POST['pass']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "index.php"; $MM_redirectLoginFailed = "login.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_Vehiculos, $Vehiculos); $LoginRS__query=sprintf("SELECT username, password FROM usuarios WHERE username=%s AND password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $Vehiculos) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();} //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- saved from url=(0014)about:internet --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>login2.jpg</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="stylelog.css" rel="stylesheet" type="text/css" /> <style type="text/css"> td img {display: block;}body { background-image: url(images/bg.jpg); background-color: #FFF; } </style> <!--Fireworks CS3 Dreamweaver CS3 target. Created Thu Jul 08 14:37:22 GMT-0500 (SA Pacific Standard Time) 2010--> </head> <body bgcolor="#ffffff" > <table width="800" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="800" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="808" border="0" align="center" cellpadding="0" cellspacing="0"> <!-- fwtable fwsrc="loginpage_mod.png" fwpage="Page 1" fwbase="login2.jpg" fwstyle="Dreamweaver" fwdocid = "1993107426" fwnested="0" --> <tr> <td width="194"><img src="images/spacer.gif" width="194" height="1" border="0" alt="" /></td> <td width="96"><img src="images/spacer.gif" width="96" height="1" border="0" alt="" /></td> <td width="131"><img src="images/spacer.gif" width="131" height="1" border="0" alt="" /></td> <td width="77"><img src="images/spacer.gif" width="77" height="1" border="0" alt="" /></td> <td width="83"><img src="images/spacer.gif" width="83" height="1" border="0" alt="" /></td> <td width="219"><img src="images/spacer.gif" width="219" height="1" border="0" alt="" /></td> <td width="10"><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td> </tr> <tr> <td height="56"> </td> <td > </td> <td > </td> <td > </td> <td> </td> <td></td> </tr> <tr> <td> </td> <td background="images/login2_r2_c2.jpg"> </td> <td colspan="2" background="images/login2_r2_c3.jpg"> </td> <td background="images/login2_r2_c5.jpg"> </td> <td> </td> <td><img src="images/spacer.gif" width="1" height="164" border="0" alt="" /></td> </tr> <tr> <td> </td> <td rowspan="2" background="images/login2_r3_c2.jpg"> </td> <td colspan="2" background="images/login2_r3_c3.jpg"><div id="layer03_holder"> <div id="left"></div> <div id="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>LOGIN <form ACTION="<?php echo $loginFormAction; ?>" id="form1" name="form1" method="POST"> <label><strong>Usuario</strong> : <input name="user" type="text" id="textfield" size="17" /> </label> <br /> <label><strong>Password</strong> : <input name="pass" type="password" id="textfield2" size="17" /> </label> </form></td> </tr> </table> </div> <div id="right"></div> </div></td> <td rowspan="2" background="images/login2_r3_c5.jpg"> </td> <td> </td> <td><img src="images/spacer.gif" width="1" height="95" border="0" alt="" /></td> </tr> <tr> <td> </td> <td background="images/login2_r4_c3.jpg"> </td> <td background="images/login2_r4_c4.jpg" id="layer03_holder_1"><form id="form2" name="form2" method="post" action=""> <input name="Submit" type="submit" style="background-color: #FFF; width: 77px; height: 19px; color: #333 ; border: #000000 thin solid; font-weight: bold;" value="Ingresar" /> </form> </td> <td> </td> <td><img src="images/spacer.gif" width="1" height="21" border="0" alt="" /></td> </tr> <tr> <td> </td> <td background="images/login2_r5_c2.jpg"> </td> <td colspan="2" background="images/login2_r5_c3.jpg"> </td> <td background="images/login2_r5_c5.jpg"> </td> <td> </td> <td><img src="images/spacer.gif" width="1" height="123" border="0" alt="" /></td> </tr> <tr> <td> </td> <td colspan="4"> </td> <td> </td> <td><img src="images/spacer.gif" width="1" height="40" border="0" alt="" /></td> </tr> </table></td> </tr> </table></td> </tr> </table> </body> </html>
Saludos
Jose Carlos