Page 1 of 1

Form to edit a redirecting table

Posted: Wed Feb 25, 2009 9:22 am
by saariko
Hi,

As this is my first post here, I hope I can get the help I need.

I am looking for a page/form to be able to edit one of our redirecting tables. Basiclly, we have a page: convert.php where the value entered in page=XXX , is getting redirected to an alternate page.

The convert.php is:

Code: Select all

<?php
#The address is:
# it will use the variable "source" from the calling page.
# please keep the table clean as possible
#http://wwww.domain.com/convert.php?source=
 
$redirecting_from=$_GET['source'];
 
if($redirecting_from == "youtube"){
        Header("Location: http://www.youtube.com/");
} elseif($redirecting_from == "cnn"){
        Header("Location: http://www.cnn.com/");
} elseif($redirecting_from == "help_en"){
        Header("Location: http://wwww.domain.com/Help/en/");
} elseif($redirecting_from == "test"){
        Header("Location: http://wwww.domain.com/wszsmf");
} elseif($redirecting_from == "staff"){
        Header("Location: http://wwww.domain.com/rxscwb");
} elseif($redirecting_from == "brochure"){
        Header("Location: http://www.domain.com/files/2008Brochure_lowres.pdf");
} elseif($redirecting_from == ""){
        Header("Location: ");
}else {
        Header("Location: http://www.domain.com/");
}
 
I want to give my users the ability to edit the name=value pairs, so they can do it on their own. They do not have access to my root, so the only/best option will be give them some php form to do it.

Thanks

p.s.
After reading this, it looks like homework, well, it isn't. My domain is: http://www.optitex.com, and you can actually visit us :-)