Page 1 of 1
Fatal error!!
Posted: Wed Feb 25, 2009 1:53 pm
by granite
Hey guys,
I'm having problems with a code.
The error I get:
Fatal error: Call to a member function on a non-object in
c:\Inetpub\vhosts\webmarcas.com.br\httpdocs\www_v3\administrador\classes\inc_acoes_site.php on line
39
The said line:
Code: Select all
$propriets=$ddp->funcoes->array_trim($props);
Can someone help me?
Re: Fatal error!!
Posted: Thu Feb 26, 2009 1:51 am
by susrisha
[code =php]
$ddp->funcoes->array_trim($props);
Please see if the variable $ddp is initialised for the class it represents.
also please post us the code before and after for some more analysis.
Re: Fatal error!!
Posted: Thu Feb 26, 2009 8:54 am
by granite
Code: Select all
$ddp=new dominio();
$ddp->comProprietario();
$prp=new dominioproprietario();
$props =array($_POST["prop1"],$_POST["prop2"],$_POST["prop3"],$_POST["prop4"]);
$propriets=$ddp->funcoes->array_trim($props);
$propriets=implode("','",$propriets);
$propriets="'".$propriets."'";
$ddp->listar(false,false,false,"dom_proprietario IN (".$propriets.")");
for($x=0;$x<$ddp->numRegs;$x++){
if($ddp->resultados[$x]["dap_id"]!=""){
$err.="\n O domínio ".$ddp->resultados[$x]["dom_url"]." do proprietário ".$ddp->resultados[$x]["dom_proprietario"]." já foi registrado por outra pessoa.";
}else{
$post=array();
$post["dap_aut_id"]=$idaut;
$post["dap_dom_id"]=$ddp->resultados[$x]["dom_id"];
$post["dap_tipo"]="n";
$post["dap_status"]="a";
$prp->trataPost($post);
$prp->salvar();
}
}
Yes, $ddp is initialised. 'funcoes' is a variable in my 'dominio' class, but I have no idea of what array_trim() does.
Also, strangely, this code works in my local server, but not in the Internet. I mean, I don't recieve any error message when running this code in my local server.
Re: Fatal error!!
Posted: Fri Feb 27, 2009 5:43 am
by granite
Sorry for double posting, but this is urgent.
Can't anyone help me?
Re: Fatal error!!
Posted: Fri Feb 27, 2009 10:28 pm
by susrisha
Code: Select all
$ddp->funcoes->array_trim($props);
funcoes as you said is a variable. But you are using it as a class object.
$a->b implies the property b of the object $a
Code: Select all
$ddp->fucnoes->array_trim($props);