undefined method createConnection()
Collapse
X
-
function _createConnection() not existed try lo locate that function and your problem is solved
-
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:
-
Try with http here or what protocol is it:
PHP Code:var $serverHost = "http://gateway.mig33.com";
Leave a comment:
-
Have you tried changing this:
eg:Originally posted by ksg91 View PostCheck parameters for method, you are passing 7 params where definition has only 6!
change:
to:PHP Code:$this->_createConnection('POST', $this->filePath, $cookie, null, $params, false, false);
PHP Code:$this->_createConnection('POST', $this->filePath, $cookie, null, $params, false);
Leave a comment:
-
because you are ECHOing the response from Login method, and Login method doesn't return anything!
Leave a comment:
-
Check parameters for method, you are passing 7 params where definition has only 6!
Leave a comment:
-
Try putting this at top of page to show your error:Originally posted by atef View Posthere is the fully class but its showing a blank page please i tired searching and trying someone help please
PHP Code:error_reporting (E_ALL);
ini_set ('display_errors', true);
Leave a comment:
-
Create a function createConnection() inside the gombile class and i guess that method will be creating connection to a database
Leave a comment:
-
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->serverHost, 80, $errno, $errstr, 100);
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, $cookie, null, $params, false, false);
$Cookies = array();
if($this->fp_handle) {
while(!feof($this->fp_handle)){
$respon = @fgets($this->fp_handle, 4096);
$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:

Leave a comment: