php 5 and register_globals=off gives lotsa errors



Hi to all.

I am having huge problems running my script, which worked fine on a
server with php 4 and register_globals turned on, on a server with php
5 and register_globals turned off.

I get errors around the area in my script where I use $_GET (not the
only error). For example the following code on my index.php file which
like many other sites I know, handles quite a large amount
if(action=="main"); etc etc. :

<?
$action = $_GET["action"]; //line 55
$sid = $_GET["sid"]; //line 56
$page = $_GET["page"]; //line 57
$who = $_GET["who"]; //line 58
?>

When I go to http://chillinglounge.net (where the error is located) I
get the following error message(s):

Notice: Undefined index: action in
C:\websites\chillinglounge.net\public_html\index.php on line 55

Notice: Undefined index: sid in
C:\websites\chillinglounge.net\public_html\index.php on line 56

Notice: Undefined index: page in
C:\websites\chillinglounge.net\public_html\index.php on line 57

Notice: Undefined index: who in
C:\websites\chillinglounge.net\public_html\index.php on line 58

Now if you would look at exactly the same script at
http://ranterswap.net you'd see absolutely no errors.

That's where I need your help. I know what is causing this error. I
believe it's the fact that register_globals is turned off.

But what I really want to know is: How do I fix it without trying to
turn register_globals on via .htaccess (because it doesn't work)?

Is there a function or some magic script that would to the trick?
Or do I have to recode my entire script and how?
.



Relevant Pages

  • mysqli error?
    ... I'm just setting up my php enviroment and I typed in a simple script ... # configuration directives that give the server its instructions. ...
    (comp.lang.php)
  • Re: How do we get there from here?
    ... >> executing on the server as a pre-processor. ... If there are client side versions of PHP, ... > name implies a static text file, is it different from a PHP script? ...
    (comp.databases.pick)
  • Re: Apache: limiting the execution place
    ... They want it so users can't use FTP, shell, or a CGI or PHP script to view, ... other users via shell, FTP, web server processes (such as PHP or CGI ...
    (Security-Basics)
  • Re: PHP chmod Newbie Question
    ... How does the server keep ... how do I create user groups for chmod to recognize? ... CHMOD is for UNIX based servers, and the PHP chmod() ... edited or removed by the PHP script, and only read by the UNIX ...
    (comp.lang.php)
  • Re: PHP in html
    ... additional calls to the server, ... to invoke a script handler for every single image. ... configuration of the webserver and the PHP interpreter. ... If you think interpreting all pages as PHP ...
    (comp.lang.php)