Skip navigation.

Need some PHP help, PLEASE

I just installed a new Linux server with PHP and MySQL. I have a BIG problem that I am not quite sure how to fix. None of my if, elseif, or else statements are evaluating expressions. They worked on the previous servor using php 4.1.2, now none of them work on php5. Here is an example page.

Here is our php info

Any help would be greatly appreciated.

Code for the page.....

Here is the code for the page.

if($spelling==$errors) {Close (eyes) || Open(mental.correct)}

Found the problem

This drove me nuts, but it turns out it was the register_globals = off that was the problem. Because the page was self calling, it messed up the second time through because either pagenum wasn't set or was set incorrectly. Anyhow it works now.


if($spelling==$errors) {Close (eyes) || Open(mental.correct)}

register_globals *should* be off

Hi Chris,

I'm glad that you found a solution. If you can run with register_globals off, it will make your code more secure and easier to understand because variables won't "magically" come into existance.
When I'm developing new apps, I like to set register_globals = off (forcing me to use the "$_" globals), as well as turn on all warnings with "error_reporting(E_ALL)". If my code runs correctly in this state I feel pretty good about the security and maintainability of it.
-- Richard

Here is the dilema. I am

Here is the dilema. I am using several recursive pages, that need to load and reload. Pages are recursive because sending to itself in 4.1.3 was more secure, the less jumps the better.
global variables are turned off, sessions are insecure, so how do I recall a page multiple times. PHP isn't like C, or Java where I can give the variable a distinction (var $pagenum:text ). At lease there isn't a way that I am aware of.

On some pages the $_Post, $_Request will work, like on the Human Science Homepage.

I am not working on this now. Just as a topic. I will work on this more once I have more time, or maybe just kill time until I can learn Acrobat 8, then just use that. :)

if($spelling==$errors) {Close (eyes) || Open(mental.correct)}