| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jan 2008
Posts: 55
|
if and if else....
This may seem just like a replay from my last switch statement post but I have tried to apply the same principals to my coding. A bit of a back story--I run a small web design company in Bali Indonesia and until I am capable of programming these things myself I hired a programmer. Though the Indonesians are quite smart they seem to take some unnecessary steps to getting the job done. Here is some coding I am trying to figure out at the moment as to how to make it work in PHP5. It all works fine in 4 but not 5. I have a feeling that I need to use the $_GET in here somewhere but where? Thanks for any help on this! PHP Code:
Last edited by hollywooood : 06-05-2008 at 02:17. |
|
|
|
|
|
#2 (permalink) |
|
Registered User
Join Date: Jan 2008
Posts: 55
|
This may help too....it's the menu include file. PHP Code:
Last edited by hollywooood : 06-05-2008 at 02:16. |
|
|
|
#3 (permalink) |
|
Web Developer
|
The reason this code, and that in your previous post, works in php4 and not in php5 is because of a setting called [ PHP: Using Register Globals - Manual ] If you click that link and read that page it will tell you in plain english what you need to be looking out for to get your code to work in PHP4. By default PHP4 used to have register_globals default to being on, so this "lazy code" would work. In PHP5, the default value is off, and in php6, you cannot use it at all. A little tip, when posting code into the forum... use the following tags around it to preserve any indentation, makes it far easier to read. [code ] // PHP [/code ] (without the spaces before the last bracket) |
|
|
|
#5 (permalink) | |
|
Moderator
Join Date: Jan 2005
Location: Brooklyn, NYC
Posts: 11,869
|
Quote:
Find good advice in the beginners web design thread.
patrick o'neill web developer | blog | spam humor |
|
|
|
|
#7 (permalink) |
|
Moderator
Join Date: Jan 2005
Location: Brooklyn, NYC
Posts: 11,869
|
Now all we need is [js ] and [/js ] Find good advice in the beginners web design thread.
patrick o'neill web developer | blog | spam humor |
|
|
|
#8 (permalink) |
|
Registered User
Join Date: Jan 2008
Posts: 55
|
Appreciate the good info and will continue to grow as a programmer unless my head pops off first. I am still unable to wrap my mind around the code that has been written and what I need to do to make it work for PHP5. Until then I used this little piece of code in my .htaccess PHP Code:
Will |
|
|
|
#9 (permalink) | |
|
Grumpy old man
Join Date: Oct 2007
Location: North Japan
Posts: 1,128
|
Let me just quote from the PHP Manual on register globals: Quote:
I'd recommend you look for another solution such as modifying your code (since it's hardly a stretch to do it). |
|
|
![]() |