hello everyone. what happens at my site is that I use a main.php file wich includes "$id.php", so all I have to do to show a page is (example: main.php?id=fan_art/index)
so now I want to have multiple pages to show screenshots by using a switch statement. but I can't use the URL way to put a variable value since the main.php file adds .php to the end of the url. therefore if I would do something like so: main.php?id=images?page=2
it would come up like this: main.php?id=images?page=2.php
so then I tryed making a function that makes $p (the page number) say....2
this is the function I include in the head of my webpage:
<?php
function p($page)
{
$p = $page;
}
?>
and this is what I use to change pages (the links)
<?php
echo "<a href=\"main.php?id=games/final_fantasy_x/images\">1</a>";
echo "-";
echo "<a href=\"#\" onClick=p(2)>2</a>";
?>
for some reason, it acts as if the function did'nt work. to see the "script" in work, click here
thanx a lot for any help