Note: This is only the release date for Decade Creations.com. This tutorial was released before this date. It is also the date of the new version of this tutorial, it should be easier to read and you should get the same results. It now includes an example file that you can download.
In this tutorial I will show you how to create your php page so that if the user goes to test.php?id=1 it will be a different page and if they went to a page like test.php?id=1)#=1 it will be a different page yet.
Okay we will start with the full script.
<?php
// Variables
$id = $_GET['id'];
$lang = $_GET['lang'];
// id = 1 and lang = 2
if ($id == 1 && $lang == 1)
{
echo 'Plays out ?id=1&lang=1';
}
//ID = 1 and lang = 2
if ($id == 1 && $lang == 2)
{
echo 'Plays out ?id=1&lang=2';
}
// ID equals 1
if ($id == 1)
{
echo 'Plays out ?id=1';
}
// ID is empty
if (!$id)
{
echo 'Nothing';
}
?>In the script above it will try and read it as: ?id=x&lang=y then it will go to just ?id=x and finally it will just go to the final one if nothing is entered.
<?php
if ($id == 1 && $lang == 1)
{
echo 'Plays out ?id=1&lang=1';
}This part of the script will say "Plays out ?id=1&lang=1" if you put page.php?id=1&lang=1
Now if you put page.php?id=1&lang=2 it would say "Plays out ?id=1&lang=2"
The other code is really simple. If id=1 it will just say "Plays out ?id=1"
and finally if you don't have anything entered it will just say "Nothing"
Like This Tutorial? Join the Community Today!













