Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/09/2014, 02:56
MORENOC
 
Fecha de Ingreso: septiembre-2014
Mensajes: 2
Antigüedad: 9 años, 7 meses
Puntos: 0
Respuesta: Problema incomprensible de Loggin

Gracias por responder.

El código que tengo es este:


---------------------------------------------

<?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['strEmail'])) {
$loginUsername=$_POST['strEmail'];
$password=md5($_POST['strPassword']);
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "UsuarioHome.html";
$MM_redirectLoginFailed = "Error_De_Acceso.html";
$MM_redirecttoReferrer = false;
mysql_select_db($database_conexioncmyk, $conexioncmyk);

$LoginRS__query=sprintf("SELECT idUsuario, strEmail, strPassword FROM tblusuario WHERE strEmail=%s AND strPassword=%s AND intActivo=1",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));

$LoginRS = mysql_query($LoginRS__query, $conexioncmyk) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($LoginRS);
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {

$MM_redirectLoginSuccess = "UsuarioHome.html";

$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;
$_SESSION['MM_idUsuario'] = $row_Recordset1["idUsuario"];

if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = "UsuarioHome.html";
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>

<form action="<?php echo $loginFormAction; ?>" method="POST" name="formacceso" id="formacceso">
E-mail
<input name="strEmail" type="text" id="strEmail" />
Password
<input name="strPassword" type="password" id="strPassword" />
<input name="BotonLOG" type="submit" id="BotonLOG" value="Acceder" />

</form>

---------------------------------------------

Con respecto al copy-Paste, me refiero a que todo el código me lo he guisado yo sólo, me he echo un "prestashop" a mi manera con mis requisitos, y lo he puesto en 2 tiendas ya, pero al ponerlo en la tercera no resulta, y el código está sin tocar, por eso no lo comprendo.
He llegado a hacer un backup de las otras tiendas y las e cargado en la nueva y tampoco, y están todas alojadas en el mismo hosting, osea que las condiciones del servidor son las mismas.

Gracias nuevamente.