Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to cause perl to quit and load an html file.

Status
Not open for further replies.

tommytx

Programmer
Nov 27, 2002
28
0
0
US
Can someone help me..
I have a perl program that does some specific things, but in the first line before it takes any real action i want it to check for a certain IP and if that IP exists, exit the perl program and load an html file.

So bottom line is it would look like this in php but not sure how to do it in perl..

PHP version just for clarification purposes. I need it in PERL.

1. Check IP
2. If Ip matches header("Location: newhtmlpage.htm");
3. If Ip does not match continue to process the perl program.
 
if ($ENV{REMOTE_ADDR} eq "10.10.10.10") {
print "Location: newhtmlpage.htm";
}
else {
#Do everything else

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Thanks that worked great I just had to add my double \n\n so the header would allow it to change pages vice just print the stuff on the screen..

print "Location: newhtmlpage.htm\n\n";

Without the \n\n it printed the text "Location: newhtmlpage.htm" on the screen vice actually travelling to the new web page...

Worked great..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top