You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by RON FLORY <ro...@adtran.com> on 2004/12/21 16:17:54 UTC

[users@httpd] Stupid Apache PHP / URL variable question

hi-

  I'm migrating a users PHP script from old Apache 1.3.22
to Apache 2.0.52 (x86 Fedora Core 3).  Almost everyting works
(including mysql access), except for the simplest, dumbest
thing- I can't seem to pass simple variables via the URL:

  For example:

     http://valen2/~ta4303/index.php?firmtype=1

  sets the variable "firmtype" to 1 on old Apache/PHP, but
the variable is unset under new Apache/PHP.

  This must be obvious to somebody- any ideas?

ron

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Stupid Apache PHP / URL variable question

Posted by RON FLORY <ro...@adtran.com>.
oxfordmusic.net wrote:
>>
>>  I'm migrating a users PHP script from old Apache 1.3.22
>> to Apache 2.0.52 (x86 Fedora Core 3).  Almost everyting works
>> (including mysql access), except for the simplest, dumbest
>> thing- I can't seem to pass simple variables via the URL:
>>
>>  For example:
>>
>>     http://valen2/~ta4303/index.php?firmtype=1
>>
>>  sets the variable "firmtype" to 1 on old Apache/PHP, but
>> the variable is unset under new Apache/PHP.
>>
>>  This must be obvious to somebody- any ideas?
>>
> 
> check the setting of Global Variables.
> you may have had them set to On on your old server and Off in the new 
> server.
> for security reasons, it's better to have them Off but it means you need 
> to use $_GET and $_POST to process form data.

  Thanks- that was it.

  These are legacy scripts in a 'user' account. I double checked to
confirm the use/misuse of the value poses no security risk.

  Also thanks for not top-posting...  ;)

ron

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Stupid Apache PHP / URL variable question

Posted by "oxfordmusic.net" <li...@oxfordmusic.net>.
>
>  I'm migrating a users PHP script from old Apache 1.3.22
> to Apache 2.0.52 (x86 Fedora Core 3).  Almost everyting works
> (including mysql access), except for the simplest, dumbest
> thing- I can't seem to pass simple variables via the URL:
>
>  For example:
>
>     http://valen2/~ta4303/index.php?firmtype=1
>
>  sets the variable "firmtype" to 1 on old Apache/PHP, but
> the variable is unset under new Apache/PHP.
>
>  This must be obvious to somebody- any ideas?
>

check the setting of Global Variables.
you may have had them set to On on your old server and Off in the new 
server.
for security reasons, it's better to have them Off but it means you need to 
use $_GET and $_POST to process form data.

andy 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Stupid Apache PHP / URL variable question

Posted by Ray Van Dolson <ra...@digitalpath.net>.
You really should rewrite your scripts to access these variables using the
$_GET, $_POST or $_REQUEST arrays... if that's not an option, set
register_globals = On in your php.ini file.

You can also set this on a per directory basis inside a <Directory> block,
.htaccess file, et al...

Ray

On Tue, Dec 21, 2004 at 09:17:54AM -0600, RON FLORY wrote:
> hi-
>
>  I'm migrating a users PHP script from old Apache 1.3.22 to Apache 2.0.52 (x86
> Fedora Core 3). Almost everyting works (including mysql access), except for
> the simplest, dumbest thing- I can't seem to pass simple variables via the
> URL:
>
>  For example:
>
>     http://valen2/~ta4303/index.php?firmtype=1
>
>  sets the variable "firmtype" to 1 on old Apache/PHP, but the variable is
> unset under new Apache/PHP.
>
>  This must be obvious to somebody- any ideas?
>
> ron

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Stupid Apache PHP / URL variable question

Posted by Luis Moreira <lu...@esinnovation.pt>.
How are you reading the variable ?
Besides $_GET, which specifically reads a get, you can use $_REQUEST 
that reads a variable, no matter how it was passed, which has its pros 
and cons...


RON FLORY wrote:

> hi-
>
>  I'm migrating a users PHP script from old Apache 1.3.22
> to Apache 2.0.52 (x86 Fedora Core 3).  Almost everyting works
> (including mysql access), except for the simplest, dumbest
> thing- I can't seem to pass simple variables via the URL:
>
>  For example:
>
>     http://valen2/~ta4303/index.php?firmtype=1
>
>  sets the variable "firmtype" to 1 on old Apache/PHP, but
> the variable is unset under new Apache/PHP.
>
>  This must be obvious to somebody- any ideas?
>
> ron
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>