Gossamer Forum
Home : General : Perl Programming :

My Win NT server got problem with: print "Location: http://yahoo.com\n\n"; HELP

Quote Reply
My Win NT server got problem with: print "Location: http://yahoo.com\n\n"; HELP
Hello !

I have the Win NT server - I don't know why the very simple perl code below doesn't work :

#!/usr/bin/perl
print "Content-type: text/html\n";
print "Location: http://www.yahoo.com\n\n";
exit;


I got the blank page Unsure ??? instead go to yahoo homepage.

I have tested this script above on Unix + other NT servers and it works well.

Hope anyone can tell me why!

Many thanks
New. A
Quote Reply
Re: [newage24] My Win NT server got problem with: print "Location: http://yahoo.com\n\n"; HELP In reply to
Firstly, can you confirm that you hvae any Perl scripts working on your NT server, or that Perl is even installed? Secondly, Perl is most likely installed at C:/perl/bin/perl...

--Philip
Links 2.0 moderator
Quote Reply
Re: [PerlFreak] My Win NT server got problem with: print "Location: http://yahoo.com\n\n"; HELP In reply to
Hi !

Thanks for your answer !

I have some CGI scripts on my server and they work. I just don't know why I got error when I use the code

print "Content-type: text/html\n";
print "Location: http://yahoo.com\n\n";

It's strange.

Hope to hear from you again !
Thanks !

N.A
Quote Reply
Re: [newage24] My Win NT server got problem with: print "Location: http://yahoo.com\n\n"; HELP In reply to
When priniting a Location header you dont need the content-type. Try;

Code:
#!/usr/bin/perl
print "Location: http://www.yahoo.com\n\n";

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!