Php being weird

software development


So I’m trying to make a simple php page. This is my code, but when I try to access the page, no matter what the URL, it always echo’s "yadda yadda"
should echo: “404”

Error! <?php

if($error == “404”){
echo “404”;
elseif($error == “500”){
echo “500”;
echo “yadda yadda”;



Are you running PHP5? The default setting for PHP5 is for register_globals to be disabled. That means, you need to adjust your script like this:[code]

Error! <?php

if($_GET[‘error’] == “404”) {
echo “404”;
} elseif($_GET[‘error’] == “500”) {
echo “500”;
} else {
echo “yadda yadda”;


[/code]---------------- Simon Jessey [url=][b]Keystone Websites[/b][/url] | [url=][b]si-blog[/b][/url]


I just noticed on the Wiki that if its php5, you can’t enable register_globals. What’s the benefit of ver 5 over 4? Thanks


There is always compiling PHP5 yourself. Boy, can I tell you horror stories lol. After some DAYS I finally managed to do it so at least now I’m confident I would be able to do it again since I’ve experienced it. I should have compiled PHP4 instead though since the script I had wanted to use still isn’t cooperating and me using PHP5 is possibly why :slight_smile:

The Insane Cabbit
My Blog
My web store:
Send me a pm if you want cms or forum software installed (for a fee)


What’s the benefit of ver 5 over 4?

For one, register_globals isn’t enabled.

If you want useful replies, ask smart questions.


[quote]What’s the benefit of ver 5 over 4?

For one, register_globals isn’t enabled.[/quote]

LOL. The point he is trying to make is that register_globals is an evil directive that causes all sorts of security risks, not to mention the fact that it creates all sorts of global variables willy nilly. Scripts designed without register_gobals are more portable than those that require it.

Aside from that, PHP5 is a significant leap forward over PHP4. The most notable change is in Object Oriented Programming (OOP), which is now robust enough to compete with the likes of Java.

Simon Jessey
Keystone Websites | si-blog