Buenas Tardes a tod@s,
Soy nuevo en el foro y me gustaría pedir algo de ayuda, he estado leyendo todo acerca de este error y no consigo solucionar el problema.
No tengo espacios delante ni detras de <?php ?>
Lo tengo con codificación ANSI
No se de que puede ser el problema, les paso mi código:
Este corresponde al archivo acceso.php
<?php require_once('Connections/conexiontiendate.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
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=$_POST['strPassword'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "acceso_ok.php";
$MM_redirectLoginFailed = "acceso_error.php";
$MM_redirecttoReferrer = false;
$cadena= "ada32445#~@as5";
$pass=$_POST['strPassword'];
$hash=$cadena.sha1($pass);
$usu= split(" ",trim($_POST["strUsuario"]));
mysql_select_db($database_conexiontiendate, $conexiontiendate);
$LoginRS__query=sprintf("SELECT idUsuario, strEmail, strPassword FROM tblusuario WHERE strEmail=%s AND strPassword=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($hash, "text"));
$LoginRS = mysql_query($LoginRS__query, $conexiontiendate) or die(mysql_error());
$row_LoginRS = mysql_fetch_assoc($LoginRS);
$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;
$_SESSION['MM_IdUsuario'] = $row_LoginRS["idUsuario"];
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"><!-- InstanceBegin template="/Templates/Principal.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>.: XEREZADE :. Coffee And Tea Shop</title>
<div class="sidebar1">
<!-- InstanceBeginEditable name="EditRegion7" --><?php include("includes/sidebar1.php"); ?><!-- InstanceEndEditable -->
</div>
Esto es conexiontiendate.php
<?php if(!isset($_SESSION)){session_start();}?><?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_conexiontiendate = "XXXXXX";
$database_conexiontiendate = "XXXXXX";
$username_conexiontiendate = "XXXXXX";
$password_conexiontiendate = "XXXXXXXX";
$conexiontiendate = mysql_pconnect($hostname_conexiontiendate, $username_conexiontiendate, $password_conexiontiendate) or trigger_error(mysql_error(),E_USER_ERROR);
?>
<?php
if (is_file("includes/funciones.php")){
include ("includes/funciones.php");
}
else
{
include ("../includes/funciones.php");}
?>
Este corresponde a acceso_ok.php
<!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"><!-- InstanceBegin template="/Templates/Principal.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>.: XEREZADE :. Coffee And Tea Shop</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<link href="css/principal.css" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Dosis:400,300,700' rel='stylesheet' type='text/css'>
<div class="sidebar1">
<!-- InstanceBeginEditable name="EditRegion7" --><?php include("includes/sidebar1.php"); ?><!-- InstanceEndEditable -->
</div>
<div class="content">
<!-- InstanceBeginEditable name="WELCOME" --><!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="flash" --><!-- InstanceEndEditable -->
<h1 class="h1"><!-- InstanceBeginEditable name="titulo" --><p class="titulote">Hola <?php include("includes/accesor.php");?></p><!-- InstanceEndEditable --></h1>
<!-- InstanceBeginEditable name="comentario" -->
<blockquote>
<p>Muchas Gracias por acceder a Xerezade</p>
</blockquote>
<!-- InstanceEndEditable --><!-- end .content --></div>
<div class="footer">
</html>
Les dejo también los includes para ver si puede ser de ahi
accesor:
<?php require_once('Connections/conexiontiendate.php'); ?>
<?php
if ((isset($_SESSION['MM_Username'])) && ($_SESSION['MM_Username'] != ""))
{
echo " ";
echo ObtenerNombreUsuario($_SESSION['MM_IdUsuario']);
}?>
Gracias anticipadas y espero que me puedan ayudar
Reciban un saludo
Deme