Jump to content
InvisionCommunity.de - Der Deutsche Invision Community Support
Sign in to follow this  
Spongebob

Problem mit Klasse

Recommended Posts

Ich habe folgendes Problem und zwar kommt folgende Fehlermeldung:

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/Dracul/htdocs/wftp2/module/ftp.php on line 25

und zwar auf folgenden quellcode:

var $con_id;

function connect(){

$this->con_id = ftp_connect($this->obj['server'],$this->obj['port']);

return;

}

function get_pwd(){

return ftp_pwd($this->con_id);

}

Danke im voraus für Eure hilfe

Share this post


Link to post

Das Problem liegt darin, dass die Funktion ftp_pwd() als Parameter eine Ressourcen ID benötigt, die normalerweise mit $this->con_id übergeben wird. Der enthaltene Wert ist aber NULL, was darauf schließen läßt, das entweder die Methode connect() vorher nicht aufgerufen wurde, da dort die Ressourcen ID übergeben wird, oder das die Verbindung nicht zustande kommt. Hier wird in der Klasse auch nicht abgefangen, wenn dies der Fall ist und somit kommt es erst in der nächsten Methode zur Fehlermeldung.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×