hi, i need a php script written for me where if in the address bar it says out.php?type=rss it will redirect to my rss feed (which is default.xml). thanks in advance
hi, i need a php script written for me where if in the address bar it says out.php?type=rss it will redirect to my rss feed (which is default.xml). thanks in advance
This will redirect to a specific page:
Where as this will include the page:PHP Code:$type = $_GET['type']; // This will store the info from the url in a variable
if ($type == "rss")
{
header('Location: http://www.whatever.com/default.php');
}
Hope that helps!PHP Code:$type = $_GET['type']; // This will store the info from the url in a variable
if ($type == "rss")
{
include('default.php');
}
hmsnacker123 (04-25-2008)
You can also do this:
PHP Code:$type = $_GET['type'];
switch($type){
case 'rss':
include($type.'.php');
break;
default:
echo "Your not on a page!";
}
Jeremy | jfein.net
hmsnacker123 (04-25-2008)
thanks nile
ok guys one more thing i need one to go :
download.php?file=example.zip
you can use the same script just replace some of the words.
Instead of $type use $file.
Might be worth having a read of this.
http://www.w3schools.com/php/default.asp
It will give you a pretty good insight into PHP.
Try this:
PHP Code:$type = $_GET['type'];
switch($type){
case 'example.zip':
echo '<a href="$type">Example.zip</a>';
break;
case 'example2.zip':
echo '<a href="$type">Example2.zip</a>';
break;
default:
echo "Your not on a page!";
}
Jeremy | jfein.net
Or Even:
Code:$file = $_GET['file']; if(file_exists($file") { header("location: $file"); } else { echo "We're sorry, that file is not available."; }![]()
-Ben -- THE DYNAMIC DRIVERS
My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
I told my client to press F5, the client pressed F, then 5, *facepalm*
Bookmarks