Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Web Design & Development
Tag Cloud
access audio blue screen bsod connection crash dell desktop drivers dvd email error excel excel 2003 firefox hard drive hardware hdmi hijackthis internet itunes keyboard laptop malware monitor motherboard network networking outlook problem ram recovery router screen slow sound spyware tdlwsp.dll trojan upgrade vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
PHP Error

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

 
Thread Tools
Callum_Dawson's Avatar
Senior Member with 304 posts.
 
Join Date: Mar 2009
Location: Manchester, UK
Experience: Advanced
12-Oct-2009, 11:29 AM #1
PHP Error
I came across this site which contains a load of PHP templates to use. I wanted this IRC bot script so I downloaded it. I installed it properly to my web server but I just get a time out error. Detailed info below:

The PHP code:
Code:
<!-- This Script is from www.hawkee.com, found at www.phpfreecode.com-->
<?
function phpbot($server, $port, $user, $nick, $realname, $channel) {
  $sockname = fsockopen($server, $port, $errno, $errstr) or exit("$errno $errstr");
  $repeat = "0";
  while ($sockread = fgets($sockname, 512)) {
    $sockread = explode(" ", $sockread);
    if (!$repeat) {
      fputs($sockname, "USER $user x x :$realname\n");
      fputs($sockname, "NICK $nick\n");
    }
    if ($sockread[0] == "PING") {
      fputs($sockname, "PONG :$sockread[1]\n");
    }
    if ($sockread[1] == "001") {
      fputs($sockname, "JOIN $channel\n");
    }
    if (fnmatch("43?", $sockread[1])) {
      fputs($sockname, "NICK $nick".str_repeat(mt_rand(0, 9), 3)."\n");
    }
    $repeat++;
  }
}
?>
<html>
<center>
<input type="button" onclick="<?=phpbot("irc.gtanet.com","6667","phpbot","phpbot","phpbot","#sanl");?>" value="Connect"/>
</center>
</html>
<br><font face="Tahoma"><a target="_blank" href="http://www.phpfreecode.com/"><span style="font-size: 8pt; text-decoration: none">PHP Free Code</span></a></font>
And the Error when going to page:
Code:
<input type="button" onclick="
Warning: fsockopen() [function.fsockopen]: unable to connect to irc.gtanet.com:6667 (Connection timed out) in /home/liquidga/public_html/development/callum/SANL/public_html/IRC.php on line 5
110 Connection timed out
__________________
C.Dawson
Anthony:-P's Avatar
Computer Specs
Senior Member with 512 posts.
 
Join Date: Nov 2006
Location: Cornwall, UK
Experience: Advanced
15-Oct-2009, 04:16 PM #2
Callum,

Many, many web hosts block access to IRC and their associated ports. IRC bots take quite a toll on it, and therefore web hosts attempt to prevent this from happening.

You'll often find it's also written in the terms of service; usually with consequences such as closure of your account if you're found to be using one or trying to use one....

You'll be better off contacting your host to ensure you're not in breach of their terms of service and that way, if you're not in breach of them you can double check whether they're allowing access to that port.

Your script, as far as i can see, is working fine.

Regards,
Anthony
__________________
RapidVPS; Non-oversold, low cost hosting - cPanel shared hosting from $2.91 p/m - VPS from $19.95 p/m
If your thread is solved, please use the thread tools menu to mark it as solved.
Lordandmaker's Avatar
Computer Specs
Member with 71 posts.
 
Join Date: Sep 2009
Location: London
Experience: Intermediate
19-Oct-2009, 12:31 PM #3
Yeah, my first port of call would be to telnet irc.gtanet.com on port 6667 (assuming you've shell access) and see if what's stopping you is in the script or below it.
Reply Bookmark and Share

Tags
code, connection, error, php, timed out

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 11:37 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.