Page 1 of 1

Inlcuding page code issue

Posted: Mon Apr 14, 2008 12:31 am
by openflame06

Code: Select all

<?php 
 
 
$page = $_GET['page'];
 
    if ($page == ""){
        $page = "home";
    }
    
include ("pages/" . $page . ".php");
?>
I am using the above code on my website but I have a problem - I need to create a hyper link to a page that is like this
<a href=\"?page=bands?Result_Set=$Res1\"> but the problem is - the above code puts .php after the file so it effectively turns the href into bands?Result_Set=$Res1.php

Anyone have any ideas on how to get rid of that, I am sure there is something simple but I am failing to find anything currently.

Re: Inlcuding page code issue

Posted: Mon Apr 14, 2008 1:33 am
by Christopher
I would probably have a second parameter named something like 'query' that contained the query parameters. I hope this script is not on a server on the Internet somewhere. It is very insecure.