Connecting Tech Pros Worldwide Forums | Help | Site Map

Godaddy Hosting blocks port 43 (newbie)

Newbie
 
Join Date: Mar 2006
Posts: 1
#1: Mar 8 '06
The program I have does a Whois search but can not use port 43 at Godaddy hosting.
http://www.netbonded.com/whois/samswhois.inc.php.

This is the code where the error occurs.

function dolookup($domain, $server){
$domain = strtolower($domain);
$server = strtolower($server);
if( $domain == '' || $server == '' ) return false;
if( $this->m_cachelifetime > 0 ){
$data = $this->readfromcache($domain, $server);
if( $data != '' ) return $data;
}
$data = "";
$fp = @fsockopen($server, 43,$errno, $errstr, $this->m_connectiontimeout);
if( $fp ){
@fputs($fp, $domain."\r\n");
@socket_set_timeout($fp, $this->m_sockettimeout);
while( !@feof($fp) ){
$data .= @fread($fp, 4096);
}
@fclose($fp);

if( $this->m_cachelifetime > 0 ) $this->writetocache($domain, $server, $data);
return $data;
}else{
return "\n\Error - could not open a connection to $server\n\n";
}
}
This is what the hosting company sent but I Do Not Known what to do with the code. It does not fit with this type of code. I have never programmed PHP. How do I redirect the port to where the hosting company has the proxy server?
curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($ch, CURLOPT_PROXY, http://64.202.165.130:3128);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

Thank you



Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,166
#2: Mar 8 '06

re: Godaddy Hosting blocks port 43 (newbie)


I've never tried anything like this before or seen the CURL library but I think they intend you to do this before your code along with a curl_exec and then a curl_close after your code.

However if this doesn't work then you should

1. Read the php documentation about CURL so that you understand what it is trying to do

2. Get back to the person/company that gave you this and ask for more help.
Reply