Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > NEWBIE: Perl CGI script that redirects to another webpage

Reply
Thread Tools

NEWBIE: Perl CGI script that redirects to another webpage

 
 
Tester
Guest
Posts: n/a
 
      01-04-2005
Hi There,

I think this is very simple. I need to write a PERL script that a form is
submitted to it, one of the forms input parameters is a URL.

Once the script has done some other processing, it redirects the users
browser to the URL.

E.g.
Webpage is Form submission.
User presses submit and it sends over form details including one (hidden)
field called URL
PERL script processes the form and then redirects browser to the URL field

I hope that makes sense and I am sure that is easy to do but I am not sure
how.

Kind regards and thanks in advance.

Dave


 
Reply With Quote
 
 
 
 
Matt Garrish
Guest
Posts: n/a
 
      01-04-2005

"Tester" <SPAM FREE WORLD> wrote in message
news:41db2985$(E-Mail Removed)...
> Hi There,
>
> I think this is very simple. I need to write a PERL script that a form is
> submitted to it, one of the forms input parameters is a URL.
>
> Once the script has done some other processing, it redirects the users
> browser to the URL.
>


Please see the perlfaqs for why you should never write PERL.

I have no idea why you would pass the final url around in a hidden field,
but the solution to your problem lies with the http header you send. Print
the correct ***redirect*** to that url and all will be well...

Googling on "perl cgi redirect" will also show you that this question has
been answered many, many times now.

Matt


 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      01-05-2005
Tester <> wrote:

> Subject: NEWBIE: Perl CGI script that redirects to another webpage



Have you seen the Posting Guidelines that are posted here frequently?


> I think this is very simple.



Then you should look for it in the Perl FAQ *before* posting
to the Perl newsgroup!


> Once the script has done some other processing, it redirects the users

^^^^^^^^
> browser to the URL.



perldoc -q redirect

How do I redirect to another page?


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
Tintin
Guest
Posts: n/a
 
      01-05-2005

"Tester" <SPAM FREE WORLD> wrote in message
news:41db2985$(E-Mail Removed)...
> Hi There,
>
> I think this is very simple. I need to write a PERL script that a form is
> submitted to it, one of the forms input parameters is a URL.
>
> Once the script has done some other processing, it redirects the users
> browser to the URL.
>
> E.g.
> Webpage is Form submission.
> User presses submit and it sends over form details including one (hidden)
> field called URL
> PERL script processes the form and then redirects browser to the URL field
>
> I hope that makes sense and I am sure that is easy to do but I am not sure
> how.
>
> Kind regards and thanks in advance.


#!/usr/bin/perl
use strict;
use CGI;

my $q = new CGI;
my $url=$q->param('url');
print $q->redirect($url);



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
what's wrong calling a Perl/CGI script in Perl/CGI script under Tomcat server? kath Perl Misc 4 04-09-2007 09:21 PM
CGI: Execute a perl script inside another perl script xdarcos@hotmail.com Perl Misc 20 01-18-2005 12:33 PM
Execute another perl script from my perl script Petterson Mikael Perl Misc 3 01-05-2005 01:31 PM
How to make Perl Script "POST" call from another Perl Script??? Wet Basement Perl 1 07-15-2003 10:25 PM



Advertisments