I have just downloaded Apache and PHP to my Windows 2000 computer to run as localhost so I can develop php pages and test them before placing the pages on my hosted website.
The problem I am having is that all my webpages rewrite themselves ($PHP_SELF?plhld=$tmp) and pass on variables in the URL. This works perfectly fine (the variables change the content of the page) on my website but the same pages do not work at all on my home computer (the new page does not recognize the passed variable).
Is there a setting I have to change in an init file??? Or is there something different with the settup on a home computer and the web?
passing variables in url on Localhost
Moderator: General Moderators
-
robertwatcher
- Forum Newbie
- Posts: 4
- Joined: Sun Aug 31, 2003 1:24 am
- Location: Ontario Canada
-
robertwatcher
- Forum Newbie
- Posts: 4
- Joined: Sun Aug 31, 2003 1:24 am
- Location: Ontario Canada
-
robertwatcher
- Forum Newbie
- Posts: 4
- Joined: Sun Aug 31, 2003 1:24 am
- Location: Ontario Canada
Yes, that is probably the most vital issue of changing it.robertwatcher wrote:...also I never realized there was a security issue involved.
Personally I also think that _POST and _GEt makes it easier for the eye when browsing the code, as they are so much self explainatory just by looking at them.
Happy rewriting. :D
-
robertwatcher
- Forum Newbie
- Posts: 4
- Joined: Sun Aug 31, 2003 1:24 am
- Location: Ontario Canada
It was much easier than I had anticipated. Thank goodness that I wrote most of my website code in modules that are "included" into the pages.
All my pages use the same include for passing and which sends the variable with the URL and reads it back at the top of the page when the page is rewritten to itself, so I only had to add - $plhld = $_GET['plhld']; - to the top of this one included module, and my whole site works properly on my computer (Localhost).
Thanks again for recommending I make the change!!!
All my pages use the same include for passing and which sends the variable with the URL and reads it back at the top of the page when the page is rewritten to itself, so I only had to add - $plhld = $_GET['plhld']; - to the top of this one included module, and my whole site works properly on my computer (Localhost).
Thanks again for recommending I make the change!!!
while it's possible and poeople have told you how, before you do you should fo search for register_globals on http://www.php.netrobertwatcher wrote:I am just calling the variable $plhld. So is there a way I can turn the registered variables on, on my Localhost setup - being I have so much code written without the GET[] and POST[] stuff?
you'll see it's turned off by default as a securit precaution. what you've done is the same as $var=$_REQUEST['variable'];
imagine for a second that the order of your request string is SCSPG and i know your calls and displays a file via a variable $page in a hidden post element.
if i call the page with ?page=/etc/skel
i will see your skel file now. i'll see stuff i should never see