You are here: Re: redirect.php?redirID=1 « All PHP « IT news, forums, messages
Re: redirect.php?redirID=1

Posted by J.O. Aho on 12/17/06 22:35

David Bagge wrote:
> How do I create a redirect.php page that i can use for many url's?
>
> Ex: http://www.mydomain.com/redirect.php?redirID=1 and
> http://www.mydomain.com/redirect.php?redirID=2
>
> My real question is how do I define a page's contents by a database.
>

--- redirect.php ---
<?PHP
/* This is a hardcoded version, a database based don't need a switch */
switch ($_REQUEST['redirID']) {
case 1:
/* redirID=1 */
header('Location: http://www.example.net');
break;
case 2:
/* redirID=2 */
header('Location: http://www.example.com');
break;
default:
/* When redirID don't match */
header('Location: http://www.microsuck.com');
break;
}
--- eof ---

--

//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация