can i go to a script-defined URL?

question: i have a script that defines a URL by inserting information (via variables) into a basic URL form:

http://...../mywebpage/$variable1.html#$variable2

currently all the script does is print the new url on a new page...is there a way to make the script run, make the new url and then -go- to the new URL (without the user doing anything other than initiating the script)?

:) thanks in advance
destyAsked:
Who is Participating?
 
jsatterlConnect With a Mentor Commented:
You have two choices...

Either use the Location tag read by
the browser, as in

print "Location: $url\n\n";

Do not print out the header/content type with this method.

-OR-

Use the http redirect supported by most browsers these days, as in

print "Content-Type:  text/html\n\n";
print "<html><head>\n";
print "<meta http-equiv=\"refresh\" content=\"0; url=$redirect\">\n";
0
 
adam923Commented:
instead of print "Content-type: text\html/n/notherstuff";
just do print "Location: http://www.yahoo.com/\n\n";
and then exit the script.
0
 
destyAuthor Commented:
yay! it works! thank you! :) :) :)
0
All Courses

From novice to tech pro — start learning today.