Cita:
¿Alguna ayuda??<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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;
}
}
$maxRows_Recordset1 = 1;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_neoparty, $neoparty);
$query_Recordset1 = "SELECT * FROM usuarios";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $neoparty) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<?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['Usuario o ID'])) {
$loginUsername=$_POST['Usuario o ID'];
$password=$_POST['Contraseña '];
$MM_fldUserAuthorization = "messageofadmin";
$MM_redirectLoginSuccess = "/index.php";
$MM_redirectLoginFailed = "/usuarios/conexion_incorrecto.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_neoparty, $neoparty);
$LoginRS__query=sprintf("SELECT `user`, pass, messageofadmin FROM usuarios WHERE `user`=%s AND pass=%s",
GetSQLValueString($loginUsername, "-1"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $neoparty) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'messageofadmin');
//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 xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<style type="text/css">
<!--
body {
background-color: #EEAD0E;
}
a:link {
color: #0000FF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #0000FF;
}
a:hover {
text-decoration: none;
color: #0000FF;
}
a:active {
text-decoration: none;
color: #0000FF;
}
.Seccion {
font-family: "Comic Sans MS";
font-size: 12px;
color: #0000FF;
}
.Estilo3 {font-size: 18px}
.Estilo4 {font-size: 14px}
.Estilo7 {font-family: "Comic Sans MS"; font-size: 12px; color: #0000FF; font-weight: bold; }
.Estilo8 {font-size: 9px}
-->
</style>
</head>
<body>
<p align="center" class="Seccion Estilo3">¡Conectate!</p>
<p align="center" class="Seccion Estilo3"> </p>
<p align="center" class="Seccion Estilo4"> </p>
<p align="center" class="Seccion Estilo4"> </p>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100" class="Seccion"><p><img src="/secciones/afiliados/88x31.png" width="88" height="31" /> </p> </td>
<td width="100"><p class="Seccion">¡Logeate!</p> </td>
</tr>
</table>
<p> </p>
<p> </p>
<form action="<?php echo $loginFormAction; ?>" method="POST" name="conexion" id="conexion">
<p align="center" class="Estilo7">Usuario
<input type="text" name="Usuario o ID" id="Usuario o ID" />
</p>
<p align="center" class="Estilo7">Contraseña
<input type="text" name="Contraseña " id="Contraseña " />
</p>
<p align="center">
<span class="Estilo7">
<input name="Enviar" type="submit" class="Estilo7" id="Enviar" value="¡Conectarme!" />
</span></p>
<p align="center" class="Seccion">Ya tenemos <?php echo $totalRows_Recordset1 ?> usuarios registrados!</p>
</form>
<p> </p>
<p> </p>
<p class="Seccion"> </p>
<p class="Seccion"> </p>
<p align="right" class="Seccion"> </p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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;
}
}
$maxRows_Recordset1 = 1;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_neoparty, $neoparty);
$query_Recordset1 = "SELECT * FROM usuarios";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $neoparty) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<?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['Usuario o ID'])) {
$loginUsername=$_POST['Usuario o ID'];
$password=$_POST['Contraseña '];
$MM_fldUserAuthorization = "messageofadmin";
$MM_redirectLoginSuccess = "/index.php";
$MM_redirectLoginFailed = "/usuarios/conexion_incorrecto.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_neoparty, $neoparty);
$LoginRS__query=sprintf("SELECT `user`, pass, messageofadmin FROM usuarios WHERE `user`=%s AND pass=%s",
GetSQLValueString($loginUsername, "-1"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $neoparty) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'messageofadmin');
//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 xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<style type="text/css">
<!--
body {
background-color: #EEAD0E;
}
a:link {
color: #0000FF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #0000FF;
}
a:hover {
text-decoration: none;
color: #0000FF;
}
a:active {
text-decoration: none;
color: #0000FF;
}
.Seccion {
font-family: "Comic Sans MS";
font-size: 12px;
color: #0000FF;
}
.Estilo3 {font-size: 18px}
.Estilo4 {font-size: 14px}
.Estilo7 {font-family: "Comic Sans MS"; font-size: 12px; color: #0000FF; font-weight: bold; }
.Estilo8 {font-size: 9px}
-->
</style>
</head>
<body>
<p align="center" class="Seccion Estilo3">¡Conectate!</p>
<p align="center" class="Seccion Estilo3"> </p>
<p align="center" class="Seccion Estilo4"> </p>
<p align="center" class="Seccion Estilo4"> </p>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100" class="Seccion"><p><img src="/secciones/afiliados/88x31.png" width="88" height="31" /> </p> </td>
<td width="100"><p class="Seccion">¡Logeate!</p> </td>
</tr>
</table>
<p> </p>
<p> </p>
<form action="<?php echo $loginFormAction; ?>" method="POST" name="conexion" id="conexion">
<p align="center" class="Estilo7">Usuario
<input type="text" name="Usuario o ID" id="Usuario o ID" />
</p>
<p align="center" class="Estilo7">Contraseña
<input type="text" name="Contraseña " id="Contraseña " />
</p>
<p align="center">
<span class="Estilo7">
<input name="Enviar" type="submit" class="Estilo7" id="Enviar" value="¡Conectarme!" />
</span></p>
<p align="center" class="Seccion">Ya tenemos <?php echo $totalRows_Recordset1 ?> usuarios registrados!</p>
</form>
<p> </p>
<p> </p>
<p class="Seccion"> </p>
<p class="Seccion"> </p>
<p align="right" class="Seccion"> </p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
Codigo de login :
ESTA TODO CONFIGURADO CON DREAMWEAVER....
Gracias al que me ayude
Estoy desesperado
La pagina que se tendria que mostrar solo cuando este logeado es:
http://neoparty.6te.net/secciones/afiliados/index.php
La pagina de conexion es:
http://neoparty.6te.net/usuarios/conectar.php
Gracias al que me ayude
A proposito para dar mas info. Trabajo con dreamweaver CS3