Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/06/2014, 13:53
arsepulveda
 
Fecha de Ingreso: junio-2014
Mensajes: 9
Antigüedad: 9 años, 10 meses
Puntos: 0
Información php mysql la pagina no esta disponible

Estimados:
tengo un problema gigante y no se si es por mi servidor local o el código derechamente. tengo mi pagina web de login con el código que indico mas abajo (index.php). mi servidor local usa vertrigo serv y estoy "programando" con dreamweaver. el codigo es autogenerado, pero las configuraciones de las bases de datos aparentan estar ok. mi ususario es root y en este caso lo deje con contraseña


en la tabla de usuarios los campos son "usuario" como primare key y "contraseña" ambos en varchar

al ingresar a la pagina me dice que esta no esta disponible


adjunto codigo

<?php virtual('/davila/Connections/usuarios.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;
}
}

$colname_Recordset1 = "-1";
if (isset($_SESSION['MM_username'])) {
$colname_Recordset1 = $_SESSION['MM_username'];
}
mysql_select_db($database_usuarios, $usuarios);
$query_Recordset1 = sprintf("SELECT * FROM users WHERE USUARIO = %s", GetSQLValueString($colname_Recordset1, "text"));
$Recordset1 = mysql_query($query_Recordset1, $usuarios) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?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['login-username'])) {
$loginUsername=$_POST['login-username'];
$password=$_POST['login-password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "/davila/page-full-width.php";
$MM_redirectLoginFailed = "/davila/index.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_usuarios, $usuarios);

$LoginRS__query=sprintf("SELECT USUARIO, `CONTRASEÑA` FROM users WHERE USUARIO=%s AND `CONTRASEÑA`=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "-1"));

$LoginRS = mysql_query($LoginRS__query, $usuarios) 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">

<html lang="es">
<head>
<meta charset="utf-8">
<title>Acceso usuario</title>

<!-- Stylesheets -->
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet'>
<link rel="stylesheet" href="css/style.css">

<!-- Optimize for mobile devices -->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>

<!-- TOP BAR -->
<div id="top-bar">

<div class="page-full-width">

<a href="https://" class="round button dark ic-left-arrow image-left ">Salir del sistema</a>

</div> <!-- end full-width -->

</div> <!-- end top-bar -->



<!-- HEADER -->
<div id="header">

<div class="page-full-width cf">

<div id="login-intro" class="fl">

<h1>INGRESO A SISTEMA DE COBRANZA REMOTO</h1>
<h5>sus credenciales son necesarias</h5>

</div> <!-- ingreso de usuario -->

<!-- logo de la compañia -->
<!-- el logo se ajustarà automaticamente a 39 pixeles. -->
<a href="#" id="company-branding" class="fr"><img src="images/company-logo.png" alt="Blue Hosting" usemap="#Map" />
<map name="Map">
<area shape="rect" coords="102,37,120,51" href="#">
</map>
</a>

</div> <!-- end full-width -->

</div> <!-- end header -->



<!-- MAIN CONTENT -->
<div id="content">

<form action="<?php echo $loginFormAction; ?>" method="POST" id="login-form">

<fieldset>

<p>
<label for="login-username">Nombre de usuario</label>
<input type="text" id="login-username" class="round full-width-input" autofocus />
</p>

<p>
<label for="login-password">password</label>
<input type="password" id="login-password" class="round full-width-input" />
</p>

<p><a href="dashboard.php" class="button round blue image-right ic-right-arrow">INGRESAR</a> </p>
</fieldset>

<br/>
<div class="information-box round">Haciendo clic en el botòn &quot;ingresar&quot; accedera a la informaciòn disponible para su usuario.</div>

</form>

</div> <!-- end content -->



<!-- FOOTER -->
<div id="footer">

<p>&copy; Copyright 2012 <a href="#">BlueHosting, LLC</a>. All rights reserved.</p>
<p><strong>SimpleAdmin</strong> theme by <a href="http://www.adipurdila.com">Adi Purdila</a></p>

</div> <!-- end footer -->

</body>
</html>
<?php
mysql_free_result($Recordset1);
?>




desde ya graciela