473,408 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

PHP 5 upgrade breaks $do?

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.)

Thanks,

--
"Always look on the bright side of life."
To reply by email, replace no.spam with my last name.
Nov 23 '05 #1
2 1201
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
Nov 23 '05 #2
Chris Hope wrote:
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.


That worked, thanks!

--
"Always look on the bright side of life."
To reply by email, replace no.spam with my last name.
Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tappy Tibbons | last post by:
Have many of you upgraded to VS 2003? We have been using Visual Studio 2002, and are somewhat satisfied, except for the following areas: Speed - VS2002 apps are dead dog slow to start up, and...
4
by: Dave Harney | last post by:
Hi Newsgroup, I'm currently using VS Ver 7.0.9466 with an OS of Server 2000 (domain controller) Ver 5.0.2195 (Build 2195) SP4. I have MSDN Universal and would like to upgrade my development...
0
by: Uma Abhyankar | last post by:
Hello, I had a program in .NET Beta1, where in I was programmatically traversing the Xml Schema using the given code snippet. However today with migration to Beta2, I am facing a compilation...
3
by: John | last post by:
Hello, I am trying to figure out how to determine if I have fixed an upgrade warning. If I delete the green text then the upgrade warning goes away. However, I would expect it to come back...
2
by: Uma Abhyankar | last post by:
Hello, I had a program in .NET Beta1, where in I was programmatically traversing the Xml Schema using the given code snippet. However today with migration to Beta2, I am facing a compilation...
36
by: Tim | last post by:
Is there a way to upgrade from Visual C++ Net 2002 to Visual C++ Net 2003? The 2002 version does not provide a Windows Forms Designer. I can't find any upgrade package on Microsoft's website. ...
2
by: George Durzi | last post by:
We recently upgraded to Exchange2K3/W2K3 from Exchange2K/W2K, and some of my c# code that I used to access users' contacts using WebDAV has stopped working. I'm getting a 401 unauthorized error....
10
by: Evie | last post by:
I understand that when a switch statement is used without breaks, the code continues executing even after a matching case is found. Why, though, are subsequent cases not evaluated? I wrote a...
5
by: joelbyrd | last post by:
Didn't know exactly where to post this, but: How do I get line breaks in a textarea? I'm pulling text from a database, and this text definately has line breaks in it, because I replaced all the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.