|
Posted by Chris Hope on 11/23/05 04:40
Russell Wallace wrote:
> A friend of mine has a set of pages at:
>
> http://ipa.buffalostate.edu/~skablah/7thSea/?do=Hideout
>
> that use PHP; recently the server company upgraded to PHP 5, which
> breaks the site; clicking on the Crew, Navigation etc links at the top
> left of the above page just brings you back to the main page.
>
> The PHP code is in a file called index.php, it's 200 lines which is
> sometimes considered excessive for posting on Usenet, but I can post
> it if need be; the relevant code appears to be:
>
> if($do == "Hideout"){ include("home.html"); }
> elseif($do == "Crew") {include("characters.htm"); }
> elseif($do == "Navigation") {include("story.htm"); }
>
> etc, and it seems that the variable $do isn't being set correctly with
> the new version. Anyone have any idea what might be wrong?
>
> (I myself know not one line of PHP, and the author of the site is by
> his own admission no expert on it, so quite possibly we're not asking
> the right questions; please let me know if we're going about this the
> wrong way. I tried Google, but it doesn't appear to accept keywords
> like $do that contain punctuation.)
Sounds like register_globals is set to off (which has been the default
since 4.3 IIRC).
You should be accessing external variables like so:
$_GET['do']
$_POST['do']
$_COOKIE['do']
using whichever super global is appropriate.
If you are not able to do this (eg big project with hundreds of pages of
code etc) then you'd need to set register_globals on for that site.
--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
[Back to original message]
|