Re: Passing a variable without ?var=

From: Ian.H (ian_at_WINDOZEdigiserv.net)
Date: 04/04/04


Date: Sun, 04 Apr 2004 02:13:10 GMT

On Sat, 03 Apr 2004 21:08:08 -0500, J. Codling wrote:

> *This message represents the official opinions of the voices
> in my head*
>
> "Carl Wiles" <carlwiles@comcast.net> wrote in message
> news:DeSdnWXoqoITovLdRVn-uw@comcast.com...
> | as far as i know there isnt really a way to hide it, other
> than masking it.
> | i mean theoretically it kind of 'has' to be there.
>
> That is my conclusion so I abandoned the idea. It doesn't
> look all that unprofessional and if I wanted to hide the
> page names I could always change to a switch statement in
> the PHP instead. I like the way it is now so I'll just leave
> it that way.
>
> Thanks for the help though!

You could use PATH_INFO:

   $pi = explode('/', $_SERVER['PATH_INFO']);
   $page = $pi[0];

   /**
    * Do validation on $page to prevent exploitation
    * left as an excercise =)
    */
   [...]

   require_once("$page.php");

Your URIs would then look something like:

   http://foo.com/index.php/bar

This would then include 'bar.php'.

Just a possible alternative =)

Regards,

  Ian

-- 
Ian.H
digiServ Network
London, UK
http://digiserv.net/


Relevant Pages

  • Re: Passing a variable without ?var=
    ... as far as i know there isnt really a way to hide it, other than masking it. ... > set the $page variable before it loads the page. ... > searched though google and can't find a thing on this. ...
    (alt.php)
  • Re: bisected boot regression post 2.6.25-rc3.. please revert
    ... this masking: ... the commit has to be reverted as it clearly isnt a NOP on your box as it was intended to be. ... as it is now some dangerous detail is hidden behind the macros. ...
    (Linux-Kernel)
  • Re: Passing a variable without ?var=
    ... *This message represents the official opinions of the voices ... in my head* ... | as far as i know there isnt really a way to hide it, ...
    (alt.php)
  • Re: P/F Crit: Apprentice
    ... Nicoll) wrote: ... in that by masking them out, one seems to shut oneself more firmly in ... one's head with the story. ... Schoenberg's piano concertos help my concentration in certain moods -- but it's not because I'm masking them out. ...
    (rec.arts.sf.composition)
  • Outer limits - series 1 - box set
    ... most part all i got was a shake of the head 'no' from the spotty 17 year ... Isnt it a modern day bastard when you want to buy something *now* with ...
    (uk.media.tv.misc)