Ciao,
dopo aver spostato il sito su un'altro server e cambiato i dati per accedere al db quando cerco di accedere con utente e password mi genera questo errore: Fatal error: Cannot access empty property in /classi/utente.inc.php on line 20
chi ha fatto il sito non c'è più e io non conosco php
linea 20:
Codice PHP:
$this->$mUser = '';
il codice della pagina utente.inc.php è il seguente:
Codice PHP:
<?php
//************************************************************************************************
// CLASSE UTENTE
//************************************************************************************************
class Utente
{
var $mUser;
var $mPassword;
var $mTabella;
var $mDB;
var $mErrore;
function Utente(&$aDB)
{
$this->$mUser = '';
$this->$mPassword = '';
$this->mTabella = "utente";
$this->mDB = $aDB;
$this->mErrore = '';
}
function Carica($aUser)
{
$unDB = $this->mDB;
$Risultato = $unDB->query("SELECT * FROM $this->mTabella WHERE user = '$aUser' ");
if (DB::isError($Risultato)) {
$this->mErrore = "class Utente - Carica - ". $Risultato->getMessage();
return FALSE;
}
if ($Risultato->numRows() != 0)
{
$unRecord = $Risultato->fetchRow();
$this->mUser = $unRecord['user'];
$this->mPassword = $unRecord['password'];
$Risultato->free();
return TRUE;
}
else {
$this->mErrore = "class Utente - Carica - Elemento ".$aUser." inesistente nella tabella ".$this->mTabella;
return FALSE;
}
}
function Salva($aUser, $aPassword)
{
$unDB = $this->mDB;
$unDB->query("INSERT INTO $this->mTabella (user,password) VALUES ('$aUser', '$aPassword')");
if (DB::isError($unDB)) {
$this->mErrore = "class Utente - Salva - ".$unDB->getMessage();
return FALSE;
}
return TRUE;
}
function Aggiorna($aUser, $aPassword)
{
$unDB = $this->mDB;
$unDB->query("UPDATE $this->mTabella SET user='$aUser',password='$aPassword' WHERE user = $aUser");
if (DB::isError($unDB)) {
$this->mErrore = "class Utente - Aggiorna - ".$unDB->getMessage();
return FALSE;
}
return TRUE;
}
function Elimina($aUser)
{
$unDB = $this->mDB;
$unDB->query("DELETE FROM $this->mTabella WHERE user = $aUser");
if (DB::isError($unDB)) {
$this->mErrore = "class Utente - Elimina - ". $unDB->getMessage();
return FALSE;
}
return TRUE;
}
function StampaUtenti()
{
$unDB = $this->mDB;
$Risultato = $unDB->query("SELECT * FROM $this->mTabella");
if (DB::isError($unDB)) {
$this->mErrore = "class Utente - Stampa - ". $unDB->getMessage();
$Risultato->free();
return FALSE;
}
else {
if ($Risultato->numRows() != 0)
{
$count = 0;
while ( $row = $Risultato->fetchRow() ) {
$arrayutente[$count]['user'] = $row['user'];
$arrayutente[$count]['password'] = $row['password'];
$count++;
}
}
$Risultato->free();
return $arrayutente;
}
$Risultato->free();
return TRUE;
}
}
?>
grazie per l'aiuto