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 acer asus bios bsod computer crash dns driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop lcd malware memory missing monitor motherboard network operating system printer problem ram registry router slow software sound toshiba trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
PHP Error

Reply  
Thread Tools
Callum_Dawson's Avatar
Senior Member with 539 posts.
 
Join Date: Mar 2009
Location: United Kingdom
Experience: Advanced
12-Oct-2009, 12:29 PM #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
Anthony:-P's Avatar
Senior Member with 521 posts.
 
Join Date: Nov 2006
Location: Cornwall, UK
Experience: Advanced
15-Oct-2009, 05: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
__________________
[/SIZE]If your thread is solved, please use the thread tools menu to mark it as solved.[/CENTER]
Lordandmaker's Avatar
Computer Specs
Member with 71 posts.
 
Join Date: Sep 2009
Location: London
Experience: Intermediate
19-Oct-2009, 01: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

Tags
code, connection, error, php, timed out

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




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



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:13 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.