Foros del Web » Programando para Internet » PHP »

$this when not in object context

Estas en el tema de $this when not in object context en el foro de PHP en Foros del Web. Me da error apache: Using $this when not in object context <?php include("utils/Usuarios.php"); $es = new Usuarios(); $es -> SetIdusuario (); { $usuario = strtolower(htmlentities($HTTP_POST_VARS["idusuario"], ...
  #1 (permalink)  
Antiguo 03/12/2008, 17:30
 
Fecha de Ingreso: diciembre-2008
Ubicación: Mexico DF
Mensajes: 30
Antigüedad: 15 años, 4 meses
Puntos: 0
$this when not in object context

Me da error apache:
Using $this when not in object context

<?php
include("utils/Usuarios.php");
$es = new Usuarios();
$es -> SetIdusuario ();

{
$usuario = strtolower(htmlentities($HTTP_POST_VARS["idusuario"], ENT_QUOTES));
$password = $HTTP_POST_VARS["contrasenia"];
$result = ('SELECT idusuario, idperfil, contrasenia, idlocalidad, nombre FROM usuarios WHERE idusuario=\''.$this->_idusuario.'\'');
if($row = mysql_fetch_array($result)){
if($row["contrasenia"] == $contrasenia){
$_SESSION["idperfil"] = $row['idperfil'];
echo '<a href="header.php">Index</a></p>';
echo '<SCRIPT LANGUAGE="javascript">
location.href = "header.php";
</SCRIPT>';
}
}
mysql_free_result($result);
}

?>



Y PODRIAN AYUDARME A MEJORAR EL CODIGO O A LIBERARLO DE WARNINGS, SI HAY PORFAVOR.....
  #2 (permalink)  
Antiguo 03/12/2008, 17:41
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: $this when not in object context

usa $_POST, en lugar de $HTTP_*_VARS

seguro que no es ... $es en lugar de $this ???


demás, ese es todo el código ???
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:25.