Author |
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: July 17 2008 at 13:29 | IP Logged
|
|
|
This was in the programming section, so I just copied it over.
Make sure you first create a Global Variable called "IP"!
Code:
insert into macroheader values ('GET IP 2','GET IP',4,4,252,96,0,0,0,12632256,0,0,1,'',10);
insert into macrodetail values ('GET IP 2',1,15,'[LOCAL1]',NULL,'ph_geturl("www.ods.org/cgi-bin/myip")',0);
insert into macrodetail values ('GET IP 2',2,16,'',NULL,'if(left("[LOCAL1]",12) <> "HTTP/1.1 200",999,1)',0);
insert into macrodetail values ('GET IP 2',3,15,'[LOCAL2]',NULL,'pos("[LOCAL1]", "~r~n~r~n") + 4',0);
insert into macrodetail values ('GET IP 2',4,15,'[LOCAL3]',NULL,'pos("[LOCAL1]","~r~n",[LOCAL2])',0);
insert into macrodetail values ('GET IP 2',5,15,'[LOCAL1]',NULL,'mid("[LOCAL1]",[LOCAL2],[LOCAL3] - [LOCAL2])',0);
insert into macrodetail values ('GET IP 2',6,37,'',NULL,'Jump out if same',0);
insert into macrodetail values ('GET IP 2',7,16,'',NULL,'if("[LOCAL1]" = "{IP}",999,1)',0);
insert into macrodetail values ('GET IP 2',8,10,'IP',NULL,'"[LOCAL1]"',0); |
|
|
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: July 17 2008 at 13:34 | IP Logged
|
|
|
Here is another version...
Code:
10 Set System [LOCAL1] ph_geturl( "www.ods.org/cgi-bin/myip")
20 Jump if( left("[LOCAL1]",12) <> "HTTP/1.1 200",999,1)
30 Set System [LOCAL1] ph_regex("^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+","[LOCAL1]",1,0,0,0)
40 User Message "[LOCAL1]"
50 Comment Jump out if same
60 Jump if( "[LOCAL1]" = "{IP}", 999, 1)
70 Jump if( len("[LOCAL1]") < 7, 999, 1)
80 Set Global IP "[LOCAL1]" |
|
|
|
Back to Top |
|
|
|
|