PDA

View Full Version : Load page?


Kixdemp
11-13-2005, 06:25 AM
Hello everyone! :-D
OK, I have a script that, when it finishes its job, I want it to return to the previous page... How do I do that? I'm looking for something like this:

load_page("../index.html");

Anyone know how to do it? Thanks! ;-)

mlseim
11-13-2005, 11:28 PM
Use this:
print "Location: http://www.mysite.com/thankyou.html\n\n";

But make sure you DON'T have this line before it
print "Content-type: text/html\n\n";

Those are the two choices....
You can redirect to another page/script, or you can
output to the user's browser.

Kixdemp
11-14-2005, 03:32 AM
Huh? I don't get it... :confused:

print "Location: http://www.mysite.com/thankyou.html\n\n";

That only prints the string to the browser, it doesn't redirect me to that page... Do you know why? Thanks! ;)

mlseim
11-14-2005, 04:09 AM
Because somewhere before the line:
print "Location: http://www.mysite.com/thankyou.html\n\n";

You have a line that looks something like this:
print "Content-type: text/html\n\n";

You can't have this line:
print "Content-type: text/html\n\n";

Attach a .txt copy of your script and we'll show you where
the content-type is getting printed. You can't print the
content-type if you plan on re-directing.

FYI,
If you're using CGI, you can do it this way too.

use CGI ':standard';

#your main script here

$redirect = "http://www.mysite.com";
print redirect( -URL => $redirect );

Kixdemp
11-14-2005, 04:18 AM
What I'm trying to do is to redirect the user to another page after the script has finished executing... Do you know? Thanks! ;)

Kixdemp
11-15-2005, 12:18 AM
Wait... That code you posted won't work, it'll just give me a blank page... Why? Thanks! ;)

Nevermind... This is what I get: <b>Status: 301 Location: ../../chatbawx.html?kixdemp</b>. Why?

mlseim
11-17-2005, 04:15 AM
I guess we're going to need to see the actual Perl script you are using.
Make it a .txt file and attach to your next post.