enat66
August 3rd, 2006, 09:14 PM
So I'm updating a website that was created with perl and mysql. I only know php and mysql so I wrote the updated version in that. The thing is I want all the old bookmarks to the .pl file to be automatically forwarded to the new page, unfortunatly I only know how to do this in php and can't figure it out in perl.
It's like this:
Someone accesses:
story.pl?1028reptiles
and I want them to be redirected to the following file:
story.php?story=1028reptiles
I tried this:
#!/usr/bin/perl
$storyid = "$ENV{'QUERY_STRING'}";
print "Location:http://www.the-index.org/cgi-bin/story.php?story=$storyid";
But the server threw a hissy-fit that I didn't have print "Content-type: text/html\n\n"; even though once that is printed I know I can't make it redirect.
How can I do this?
Thanks in Advance:)
It's like this:
Someone accesses:
story.pl?1028reptiles
and I want them to be redirected to the following file:
story.php?story=1028reptiles
I tried this:
#!/usr/bin/perl
$storyid = "$ENV{'QUERY_STRING'}";
print "Location:http://www.the-index.org/cgi-bin/story.php?story=$storyid";
But the server threw a hissy-fit that I didn't have print "Content-type: text/html\n\n"; even though once that is printed I know I can't make it redirect.
How can I do this?
Thanks in Advance:)