The errors found were:
Notice: A session had already been started - ignoring session_start()
getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
Undefined variable: resultadoVer
Notice: A session had already been started - ignoring session_start()
Notice: Undefined index: Key
Notice: Trying to get property of non-object
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
Regarding the source code, we are using OOP:
include("inc/Conecta.class.php");
include("inc/Metodos.class.php");
$metodos = new Metodos();
We make the connection:
class Conecta{
private $Servidor = 'XXX';
private $Usuario = 'XXX';
private $Senha = 'XXX';
private $Banco = 'XXX';
protected $Conecta;
protected $Teste;
public function conectar(){
$this->Conecta = mysqli_connect($this->Servidor,$this->Usuario,$this->Senha,$this->Banco) or die("Erro 001: Erro ao conectar no servidor");
if ($this->Conecta == false) {
printf("Erro ao conectar: %s\n", mysqli_connect_errnor());
$this->erro(mysqli_connect_errnor());
exit();
}
mysqli_set_charset($this->Conecta, "utf8");
}
public function erro($erro_valor){
error_log(filter_input(INPUT_SERVER,"PHP_SELF")." - Erro: 01 (".@date("d/m/Y") ." as ".@date("H:i").") - ".$erro_valor."\r\n",3,"log/erro.log");
}
public function fechar(){
mysqli_close($this->Conecta);
}
}
And Metodos.class.php has almost 2000 lines, it would be a lot. So we're doing it this way:
class Metodos extends Conecta{
***// As linhas seguem abaixo***
// Erro: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
$hoje = getdate();
// Erro: Undefined variable: resultadoVer
$resultadoVer .= "<div class=\"list-group\">";
// Erro: Undefined property: stdClass::$IdCodUsuarios
public function usuariosOnline($idUsuarios) {
$resultados = "<a href='enviar.php?Key=".$jmVerPerfil->IdCodUsuarios."'";
return $resultados;
}
// Erro: Notice: Trying to get property of non-object
public function cadastrarVisitas($id,$idVisitado){
$conectar = new Conecta();
$conectar->conectar();
$sqlVerificar = mysqli_query($conectar->Conecta, "SELECT * FROM verificar WHERE IdVisitantes = ".$id." AND IdVisitado = ".$jmVisitado->IdUsuarios."");
......
}
The PHP version of the current server is PHP: 5.5.23. From the old server I can not remember.