Anzeige - [Hier werben / Mediadaten]
(?) Tags raten (?) (edit)
 
Reply to this topicStart new topicStart Poll
> PHP (Nuke) unverständliche Fehlermeldung
Pascal Grenacher
Geschrieben am: Mi 29.12.2004, 14:50
Report PostQuote Post

AyomRank 1
**

Gruppe: Member (inaktiv)
Beiträge: 2
Mitglied seit: 29.12.2004


Grüss euch zusammen, zur Begrüssung mal ein fettes Lob, lese seit geraumer Zeit in diesem genialen Forum. biggrin.gif

Nun ebenfalls seit geraumer Zeit (+/- ne Woche beschäftige ich mich mit PHP laugh.gif ) Daher Ihr Supercoder bitte nicht hauen, bin noch fast ein DAU [/CODE] unsure.gif

Ich erhalte folgende Fehlermeldung welche ich nicht interpretieren kann: dry.gif

QUOTE
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/xxx/xxx/html/modules/WebMail/pop3.php on line 91

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/xxx/xxx/html/modules/WebMail/pop3.php on line 91

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/xxx/xxx/html/modules/WebMail/pop3.php on line 159

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/xxx/xxx/html/modules/WebMail/pop3.php on line 161

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/xxx/xxx/html/modules/WebMail/pop3.php on line 183



Anbei dein Ausschnitt aus dem entsprechendem pop3.php:
CODE


/*       Code zu Fehlermeldung Line  91    */
$this->connection = fsockopen($this->hostname,$this->port, &$errno, &$errstr);

/*       Code zu Fehlermeldung Line 159    */
$this->POP3Command("STAT", &$result);

/*       Code zu Fehlermeldung Line 161    */
$this->POP3Command("LIST $msg", &$result);

/*       Code zu Fehlermeldung Line 183    */
$this->POP3Command("UIDL $message", &$result);



Vollständiges pop3.php:

CODE

<?php

class POP3{
       var $hostname;
       var $user;
       var $password;
       var $apop="";
       var $port=110;
       var $DEBUG=0;
       var $exit = true;
       var $has_error = false;

       var $connection=0;
       var $greeting = "";
       var $state="DISCONNECTED";
       var $must_update=0;

       function POP3($hostname,$user,$password,$apop="") {
               $this->hostname = $hostname;
               $this->user = $user;
               $this->password = $password;
               $this->apop = $apop;
       }

        function AddError($error) {
                $this->has_error = true;
                echo "<center>\n";
         echo "<b>Error:</b> $error\n";
                echo "</center>\n";
                $this->CloseConnection();
                if ($this->exit) exit;
       }

       function POP3Command($command, $result="") {
               if ($this->DEBUG) echo "<b>Sending Command: </b>".$command."<br>";flush();
               @fputs($this->connection, "$command\r\n");
               $result = @fgets($this->connection, 99999);

               if (eregi("^(\+OK)", $result)) :
                       if ($this->DEBUG) echo "<b>Result OK: </b><br>";flush();
                       return true;
               else :
                       $this->AddError($result);
               endif;
       }
        function OpenConnection() {
                if ($this->DEBUG) echo "<b>Openning Connection to: </b>".$this->hostname."<br>";flush();
                if($this->hostname=="")
                          $this->AddError("You must specified a valid hostname");
                  $this->connection = fsockopen($this->hostname,$this->port, &$errno, &$errstr);
               if ($this->DEBUG) echo "<b>Connection opened </b><br>";flush();
                  if (!($this->connection)) :
                          if ($errno == 0)
                                   $this->AddError("Invalid Mail Server Name or Server Connection Error");
                          $this->AddError($errno." ".$errstr);
                  endif;
               return true;
        }

        function CloseConnection() {
                 if($this->connection!=0) :
                          fclose($this->connection);
                          $this->connection=0;
               endif;
        }

        function Open() {
                 if($this->state!="DISCONNECTED")
                          $this->AddError("1 a connection is already opened");
                 $this->OpenConnection();
                       $this->greeting = @fgets($this->connection, 99999);
                         if(GetType($this->greeting)!="string" OR strtok($this->greeting," ")!="+OK") :
                                  $this->CloseConnection();
                                  $this->AddError("2 POP3 server greeting was not found");
                         endif;
                 $this->greeting=strtok("\r\n");
                 $this->must_update=0;
                 $this->state="AUTHORIZATION";
                 $this->Login();
                 return true;
        }

/* Close method - this method must be called at least if there are any
    messages to be deleted */

        function Close() {
                 if($this->state=="DISCONNECTED")
                          $this->AddError("no connection was opened");
                 if($this->must_update)
                          $this->POP3Command("QUIT");
                 $this->CloseConnection();
                 $this->state="DISCONNECTED";
                 return true;
        }

       function Login() {
                 if($this->state!="AUTHORIZATION")
                          $this->AddError("connection is not in AUTHORIZATION state");
                 if($this->apop) :
                          $this->POP3Command("APOP $this->user ".md5($this->greeting.$this->password));
                 else :
                         $this->POP3Command("USER $this->user");
                         $this->POP3Command("PASS $this->password");
                 endif;
                 $this->state="TRANSACTION";
        }

       function Stats($msg=""){
                 if($this->state!="TRANSACTION")
                          $this->AddError("connection is not in TRANSACTION state");
                 if ($msg == "") :
                         $this->POP3Command("STAT", &$result);
                 else :
                         $this->POP3Command("LIST $msg", &$result);
                 endif;
                 $p = explode(" ", $result);
                 $stat["message"] = $p[1];
                 $stat["size"] = $p[2];
                 return $stat;
        }

       function GetHeaders($message=1) {
               $this->POP3Command("TOP $message 0");
               for ($headers="";;) {
                       $line = fgets($this->connection, 99999);
                         if (trim($line) == "." OR feof($this->connection)) {
                                 break;
                       }
                         $headers .= $line;
                 }
               return $headers;
       }

       function GetMessageID($message="") {
               if ($message) :
                       $this->POP3Command("UIDL $message", &$result);
                       $id = explode (" ", $result);
                       return ereg_replace("[<>]","",$id[2]);
               else :
                       $this->POP3Command("UIDL");
                       while (!feof($this->connection)) :
                               $line = fgets($this->connection, 99999);
                               if (trim($line) == ".") {
                                         break;
                               }
                               $part = explode (" ", $line);
                               $part[1] = ereg_replace("[<>]","",$part[1]);
                               $id[$part[0]] = $part[1];
                       endwhile;
                       return $id;
               endif;

       }

       function GetMessage($msg=1) {
               $i = 0;
               $this->POP3Command("RETR $msg");
               for ($m="";;) {
                       $line = fgets($this->connection, 999999);
                       if (trim($line) == "." OR feof($this->connection)) {
                                 break;
                       }
                       if (chop($line) == ""  AND $i < 1) :
                               $message["header"] = $m;
                               $i++;
                       endif;
                       if ($i > 0)
                               $messagebody .= $line;
                       $m .= $line;
               }
               $message["body"] = $messagebody;
               $message["full"] = $m;
               return $message;
       }

       function ListMessage($msg) {
               $list = array();
               $list["has_attachment"] = false;
               $list["size"] = '';
               $this->POP3Command("RETR $msg");
               for ($m="";;) {
                       $line = fgets($this->connection, 99999);
                       $list["size"] += strlen($line);
                       if (trim($line) == "." OR feof($this->connection)) {
                                 break;
                       }
                       if (eregi("^Subject: (.*)", $line, $reg))
                               $list["subject"] = $reg[1];
                       if (eregi("^Date: (.*)", $line, $reg))
                               $date = $reg[1];
                       if (eregi("^From: (.*)", $line, $reg))
                               $from = $reg[1];
                       if (eregi("^Content-Disposition: attachment", $line) OR eregi("^Content-Disposition: inline", $line))
                               $list["has_attachment"] = true;;
               }
               eregi("(.+) (.+) (.+) ([0-9]{1,2})([0-9]{1,2}) (.+):(.+):(.+) .+", $date, $dreg);
               $list["date"] = $dreg[1]." ".$dreg[2]." ".$dreg[3];
               $from = eregi_replace("<|>|\[|\]|\(|\)|\"|\'|(mailto:)", "", $from);
                if (eregi("(.*)? (.+@.+\\..+)", $from)) :
                          eregi("(.*)? (.+@.+\\..+)", $from, $reg);
                          $list["sender"]["name"] = $reg[1];
                          $list["sender"]["email"] = $reg[2];
                else :
                        eregi("(.+@.+\\..+)", $from, $reg);
                        $list["sender"]["name"] = $reg[1];
                        $list["sender"]["email"] = $reg[1];
               endif;
               return $list;
       }

        function DeleteMessage($message) {
                 if($this->state!="TRANSACTION")
                          $this->AddError("connection is not in TRANSACTION state");
                 $this->POP3Command("DELE $message");
               $this->must_update=1;
                 return true;
        }

        function ResetDeletedMessages() {
                 if($this->state!="TRANSACTION")
                          $this->AddError("connection is not in TRANSACTION state");
                 $this->POP3Command("RSET");
                 $this->must_update=0;
                 return("");
        }

        function NOOP() {
                 if($this->state!="TRANSACTION")
                          $this->AddError("connection is not in TRANSACTION state");
                 $this->POP3Command("NOOP");
                 return("");
         }
};

?>


Für ne Hilfestellung bedanke ich mich schon im voraus.


--------------------
Rechtschreibefehler dienen der allgemeinen Belustigung und dürfen behalten werden.
Top
PMEmail Poster
Top
 
 
Mike
#2 Geschrieben am: Mi 29.12.2004, 18:25 (+03:34)
Report PostQuote Post

AyomRank 4
Group Icon

Gruppe: Experten Entwicklung
Beiträge: 175
Mitglied seit: 22.12.2004


Liegt an der Übergabe der Referenzen.
Du musst die "&" vor der Variable weglassen, dann sollte es gehen. So sieht es dann aus:

CODE
/*       Code zu Fehlermeldung Line  91    */
$this->connection = fsockopen($this->hostname,$this->port, $errno, $errstr);

/*       Code zu Fehlermeldung Line 159    */
$this->POP3Command("STAT", $result);

/*       Code zu Fehlermeldung Line 161    */
$this->POP3Command("LIST $msg", $result);

/*       Code zu Fehlermeldung Line 183    */
$this->POP3Command("UIDL $message", $result);



Erklärung zu Referenzen stehen auch in der PHP-Dokumentation: http://de.php.net/manual/de/language.references.php
Top
PM
Top
 
Pascal Grenacher
#3 Geschrieben am: Mi 29.12.2004, 19:19 (+00:54)
Report PostQuote Post

AyomRank 1
**

Gruppe: Member (inaktiv)
Beiträge: 2
Mitglied seit: 29.12.2004


... and it works... smile.gif

Sehe derzeit vor lauter Bäumen den Wald nicht mehr !!!!! laugh.gif

Danke dir Mike !!!!

Danke noch für das Tut....


--------------------
Rechtschreibefehler dienen der allgemeinen Belustigung und dürfen behalten werden.
Top
PMEmail Poster
Top
 
Thema wird von 0 Benutzer(n) gelesen (0 Gäste und 0 anonyme Benutzer)
0 Mitglieder:
Trackback-Url: http://www.ayom.com/track/t/5240

Topic Options Reply to this topicStart new topicStart Poll

 


> Ähnliche Themen
Formulareingabe (Ausgabe Fehlermeldung) Promada 144 4 Do 28.08.2008, 00:17
Fehlermeldung im Forum Sami Demirel 188 5 So 6.04.2008, 19:07
Formular bringt keine Fehlermeldung? japsa 313 0 Do 31.01.2008, 11:09
Fehlermeldung bei Tradedoubler (Schweiz) MISC 377 6 Mo 28.01.2008, 13:04
Fehlermeldung bei Installation wasserwerk 112 1 So 27.01.2008, 13:37
PHP-Fehlermeldung ? japsa 169 3 Di 13.11.2007, 12:33
SQL Fehlermeldung jerry70 504 7 Mo 10.09.2007, 15:39
Fehlermeldung, verstehe den Sinn nicht Brian Folte 511 27 Fr 17.08.2007, 13:31
Wordpress Fehlermeldung (gelöst) Martin H 185 1 Mi 4.07.2007, 14:41
Fehlermeldung jumber 298 4 Do 22.02.2007, 01:21




Anzeige - [Hier werben / Mediadaten]



Anzeigen


[Hier werben / Mediadaten]