I need to redirect from a Perl script that is passed the value "shop" in a string E.g. http://mysite.co.uk/cgi/shop/redirect.pl?shop=rg
I need this to redirect to a section of a new shop with an address like: mynewsite.co.uk/store/index.php?cPath=1
I've been told it would look something like this:
#!/usr/bin/perl
use CGI 'standard';
$shop = param('shop');
if ($shop eq 'rg') {
print redirect('https://www.planetdistribution.co.uk/store/index.php?c
+Path=6');
}elsif ($shop eq 'ps') {
print redirect('https://www.planetdistribution.co.uk/store/index.php?c
+Path=1');
}elsif ($shop eq 'sk') {
print redirect('https://www.planetdistribution.co.uk/store/index.php?c
+Path=19');
}elsif ($shop eq 'smm') {
print redirect('https://www.planetdistribution.co.uk/store/index.php?c
+Path=9');
}else{
print redirect('https://www.planetdistribution.co.uk/store');
}
But I can't get it to work as hard as I try. Is there any more coding I need to do to the page, I've been setting the permissions to 777. Is this right?
Help!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.