Page 2 of 2

Posted: Wed Mar 09, 2005 3:28 pm
by w00t
How about we do this over IRC sometime? :p

You can either contact me at my network (see sig) or on unreal.

Posted: Wed Mar 09, 2005 5:40 pm
by Number
Whit the help of w00t now i have this (thanks a lot w00t ...)

Code: Select all

<?
set_time_limit(0); 

$serv=  "localhost"; 

echo "Opening socket to $serv ...<br>"; 

$fp = fsockopen($serv,6667); 

echo "Sending NICK and USER...<br>";
 
fputs($fp,"USER Test localhost localhost :register\r\n"); 
fputs($fp,"NICK Test\r\n"); 


 while ($line = fgets($fp,1024)) 
 { 
         $a = explode(" ", $line); 
         echo "<= $line <br />"; 
	flush();



 switch ($a[0]) 
 { 
 case "PING": 

 fputs($fp, 'PONG '.$a[1].' \r\n'); 

 echo '=> PONG '.$a[1].'<br/>'; 

 break; 

 default: 
 break; 
 } 

 switch ($a[1]) 
 { 
 case "001":

 fputs($fp,"STATS #Bienvenue\r\n"); 
 break; 
 default: 
 break; 
         } 
}
?>
And when i go to my web page :
Opening socket to localhost ...
Sending NICK and USER...
<= :irc.number.no-ip.org NOTICE AUTH :*** Looking up your hostname...
<= :irc.number.no-ip.org NOTICE AUTH :*** Found your hostname
<= :irc.number.no-ip.org NOTICE Test :*** If you are having problems connecting due to ping timeouts, please type /quote pong EAEA18D2 or /raw pong EAEA18D2 now.
<= PING :EAEA18D2
=> PONG :EAEA18D2
<= :irc.number.no-ip.org 001 Test :Welcome to the ROXnet IRC Network [email protected]
<= :irc.number.no-ip.org 002 Test :Your host is irc.number.no-ip.org, running version Unreal3.2.2b
<= :irc.number.no-ip.org 003 Test :This server was created Sat Jan 15 18:37:22 2005
<= :irc.number.no-ip.org 004 Test irc.number.no-ip.org Unreal3.2.2b iowghraAsORTVSxNCWqBzvdHtGp lvhopsmntikrRcaqOALQbSeKVfMGCuzNT
<= :irc.number.no-ip.org 005 Test CMDS=KNOCK,MAP,DCCALLOW,USERIP SAFELIST HCN MAXCHANNELS=10 CHANLIMIT=#:10 MAXLIST=b:60,e:60 NICKLEN=30 CHANNELLEN=32 TOPICLEN=307 KICKLEN=307 AWAYLEN=307 MAXTARGETS=20 WALLCHOPS :are supported by this server
<= :irc.number.no-ip.org 005 Test WATCH=128 SILENCE=15 MODES=12 CHANTYPES=# PREFIX=(qaohv)~&@%+ CHANMODES=be,kfL,l,psmntirRcOAQKVGCuzNSMT NETWORK=ROXnet CASEMAPPING=ascii EXTBAN=~,cqnr ELIST=MNUCT STATUSMSG=~&@%+ EXCEPTS :are supported by this server
<= :irc.number.no-ip.org 251 Test :There are 8 users and 5 invisible on 4 servers
<= :irc.number.no-ip.org 252 Test 9 :operator(s) online
<= :irc.number.no-ip.org 254 Test 1 :channels formed
<= :irc.number.no-ip.org 255 Test :I have 4 clients and 3 servers
<= :irc.number.no-ip.org 265 Test :Current Local Users: 4 Max: 9
<= :irc.number.no-ip.org 266 Test :Current Global Users: 13 Max: 15
<= :irc.number.no-ip.org 375 Test :- irc.number.no-ip.org Message of the Day -
<= :irc.number.no-ip.org 372 Test :- 3/3/2005 15:46
<= :irc.number.no-ip.org 372 Test :- Test
<= :irc.number.no-ip.org 372 Test :- Motd file is not missing
<= :irc.number.no-ip.org 376 Test :End of /MOTD command.
<= :Test MODE Test :+iwx
<= :irc.number.no-ip.org 421 Test \r\nSTATS :Unknown command
I work perfectly the only thing that don't run it the STATS command why ???

Posted: Wed Mar 09, 2005 6:58 pm
by heinz
fputs($fp, 'PONG '.$a[1].' \r\n');


needs to be

fputs($fp, "PONG ".$a[1]." \r\n");


PHP will only interpret things in double-quotes.. anything in single-quotes will be left as-is.. and therefore your \r\n won't become a linebreak, it'll stay as \r\n.

Posted: Wed Mar 09, 2005 7:20 pm
by Number
Thanks and sorry ..
For the var i know .. But for \r\n i don't know ...

Why its so long ?? (see the result here)

http://number.no-ip.org/test.php?show=source
http://number.no-ip.org/test.php

Posted: Thu Mar 10, 2005 11:25 am
by Number
because set_time_limit(0) don't stop the script ...

And the script run while /quit was not write ...

Posted: Sun Mar 13, 2005 2:29 pm
by Number
I'm come back ...

I would like to run my script php on a cgi script ...

And i use a boucle for incoming message from irc server ..

But if they are nobody in the chat room the script quit ..
(Because they are no incomming msg ..)

You have a idéa to run it permanently ??

Thanks ..

Posted: Mon Mar 14, 2005 3:54 am
by Matridom
Number wrote:I'm come back ...

I would like to run my script php on a cgi script ...

And i use a boucle for incoming message from irc server ..

But if they are nobody in the chat room the script quit ..
(Because they are no incomming msg ..)

You have a idéa to run it permanently ??

Thanks ..
make a special class for the webconnection

set a lower ping time (like 30 seconds or less) and have the ping/pong response keep the script active

Posted: Mon Mar 14, 2005 7:03 am
by Number
Thanks ...