undefined method createConnection()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • timo
    replied
    function _createConnection() not existed try lo locate that function and your problem is solved

    Leave a comment:


  • atef
    replied
    yeah, and i done my porject
    Thank u guys!

    Leave a comment:


  • ksg91
    replied
    did you even read this?

    Originally posted by ksg91 View Post
    because you are ECHOing the response from Login method, and Login method doesn't return anything!

    Leave a comment:


  • razzbee
    replied
    Dont hide all errors when debuging scripts,its better to some times hide only warnings since they dont stop the cript from executing,so use this
    error_reporting("E^WARNING"); after the <?php tag in your page

    Leave a comment:


  • arnage
    replied
    Try with http here or what protocol is it:

    PHP Code:
    var $serverHost "http://gateway.mig33.com"

    Leave a comment:


  • atef
    replied
    @something yea i tried that bro
    Hope someone gonna fix it

    Leave a comment:


  • something else
    replied
    Have you tried changing this:
    Originally posted by ksg91 View Post
    Check parameters for method, you are passing 7 params where definition has only 6!
    eg:
    change:
    PHP Code:
    $this->_createConnection('POST'$this->filePath$cookienull$paramsfalsefalse); 
    to:
    PHP Code:
    $this->_createConnection('POST'$this->filePath$cookienull$paramsfalse); 

    Leave a comment:


  • atef
    replied
    but the class is not working bro. Thats why i posted it...

    Leave a comment:


  • ksg91
    replied
    because you are ECHOing the response from Login method, and Login method doesn't return anything!

    Leave a comment:


  • atef
    replied
    thanks something else i added the code but it still a blank page.

    Leave a comment:


  • ksg91
    replied
    Check parameters for method, you are passing 7 params where definition has only 6!

    Leave a comment:


  • something else
    replied
    Originally posted by atef View Post
    here is the fully class but its showing a blank page please i tired searching and trying someone help please
    Try putting this at top of page to show your error:
    PHP Code:
    error_reporting  (E_ALL);
    ini_set ('display_errors'true); 

    Leave a comment:


  • atef
    replied
    @s3nzo its already on it, check carfully

    Leave a comment:


  • s3nzo
    replied
    Create a function createConnection() inside the gombile class and i guess that method will be creating connection to a database

    Leave a comment:


  • atef
    replied
    here is the fully class but its showing a blank page please i tired searching and trying someone help please

    PHP Code:
    <?php

    class gombile


    var 
    $serverHost "gateway.mig33.com"
    var 
    $serverPort 25
    var 
    $filePath "/member2/t.php";
    var 
    $username null;
    var 
    $userdef "cah_gombile";
    var 
    $_cookie null;
    var 
    $fp_handle null;
    var 
    $_respon null;
    var 
    $_debug true;
    var 
    $_debugMsg = array();
    var 
    $inRoom false;
    var 
    $isPV false
    var 
    $startKick false;
    var 
    $kickMe false

    function 
    _createConnection($method 'GET'$file '/'$referer null,
                            
    $cookie null$content null$close true)
       {
          
    $this->fp_handle = @fsockopen ($this->serverHost80$errno$errstr100);
          if(!
    $this->fp_handle) {
             exit(
    "can not connect to $this->serverHost");
          }
          
          
    $method strtoupper($method);
          if(!
    in_array($method, array('GET''POST')) || is_null($content)) {
             
    $method 'GET';
          }
          
          if(
    is_null($referer)) {
             
    $referer $this->serverHost;
          }
          
          if(
    is_null($cookie)) {
             
    $cookie $this->_cookie;
          }
          
          
    $data "$method $file HTTP/1.1\n";
          
    $data.= "Accept: */*\n";
          
    $data.= "Accept-Language: fa\n";
          
    $data.= "Referer: $referer/\n";
          
    $data.= "Content-Type: application/x-www-form-urlencoded; charset=UTF-8\n";
          
    $data.= "Accept-Encoding: gzip, deflate\n";
          
    $data.= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; .NET CLR 1.1.4322)\n";
          
    $data.= "Host: $this->serverHost\n";
          
    $data.= "Connection: Keep-Alive\n";
          
    $data.= "Cache-Control: no-cache\n";
          
    $data.= "Cookie: $cookie\n";
          
          if(
    $method == 'POST') {
             
    $length strlen($content);
             
    $data.= "Content-Length: $length\n\n";
             
    $data.= $content;
          } else {
             
    $data.= "\n";
          }
          
          @
    fputs ($this->fp_handle$data);
          if(
    $close) @fclose($this->fp_handle);
       }

    function 
    Login($usr$pwd$rem=false$inv=false$ret=false){
    $cookie is_null($this->_cookie)?""$this->_cookie
    $usr urlencode($usr);
    $pwd urlencode($pwd);

    $params "cmd=login&username=$usr&password=$pwd"
    $params .= ($rem === true?"&rememberName=on":"");
    $params .= ($inv === true?"&invisible=on":""); 


    $this->_createConnection('POST'$this->filePath$cookienull$paramsfalsefalse); 
    $Cookies = array(); 

    if(
    $this->fp_handle) {
    while(!
    feof($this->fp_handle)){

    $respon = @fgets($this->fp_handle4096);
    $this->_respon .= $respon

    $isCookie stristr($respon"set-cookie");
    if(
    $isCookie) {
    $Cookies[] .= trim(str_ireplace("set-cookie: """$isCookie)); 
    }
    }
    }else{
    $this->_debugMsg[] .= "<span>Sorry, we couldn't connect to the mig33
    server. This is out of our control.</span>"
    ;
    }
    }
    }

    ?>


    <?php

    $usr
    ="username"
    $pwd="password"

    $log=new gombile(); 
    echo 
    $log->Login($usr$pwd$rem=false$inv=false$ret=false);

    ?>

    Leave a comment:

Working...
X