5plit_func has asked for the wisdom of the Perl Monks concerning the following question:
Good day all i am learning CGI using perl and i developed simple script that redirect a user based on form selection to a given website. the code follows below.
if($query->param('op') eq "ds") { print $query->redirect($query->param('website')); }else { print" <html><head><title>Web redirection</title></head> <body> <form action=\"redirect.pl\" method=\"post\" > <fieldset> <legend>Kindly select a website to visit</legend> <strong>Select a website form the list:</strong> <select name=\"website\"> <option value=\"www.sedocaonline.com\">Sedocaonline.com</option> <option value=\"http://www.yahoo.co.uk\">Yahoo.co.uk</option> <option value=\"http://www.play.com\">play.com</option> </select> <input type=\"hidden\" name=\"op\" value=\"ds\" > <input type=\"submit\" name=\"submit\" value=\"Browse the web\"> </form> </body> </html>"; }
The issue here is the code does not redirect the user to the selected website it gives this respond code on the browser.
Status: 302 Found Location: www.sedocaonline.comPlease i kindly need your assistance and comments thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI redirection
by tobyink (Canon) on Jan 17, 2013 at 14:20 UTC | |
by 5plit_func (Beadle) on Jan 18, 2013 at 10:03 UTC | |
|
Re: CGI redirection
by NetWallah (Canon) on Jan 17, 2013 at 16:13 UTC | |
|
Re: CGI redirection
by Anonymous Monk on Jan 17, 2013 at 14:25 UTC | |
|
Re: CGI redirection
by 7stud (Deacon) on Jan 18, 2013 at 00:33 UTC | |
|
Re: CGI redirection
by alpha (Scribe) on Jan 18, 2013 at 08:31 UTC |