I have written codes to redirect a page by passing in parameters when clink on the link..
index.php
<a href="index.php?page=test">test</a> .......... .......... $result =$_GET[page]; if ($result) { ............. } else include "main.php";
but then i realize that my index.php would have to take a param inorder for my main.php to load up.. is there a way to go around this?
Thanks
First you should use ' signs in the get-array, like this: $_GET['page']
Second, you can do something like this:
if (isset($_GET['page'])) { $result = $_GET['page']; } else { $result = "main"; }
cool thats exactly what I needed thanks Piranha
Don't forget to mark this thread resolved.