Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 17th, 2005, 05:58 AM
Chris
Guest
 
Posts: n/a
Default PHP config(?) problem

I'm trying to learn PHP, and I'm having a strange problem with my local
install on SuSE 9.0. I have a script here:

http://www.little-people-austin.com/~chris/estpop.php

Here, it works fine. When I try to run the same script on my local machine,
however, I always get "0". I tried a little debug code, and none of the
form values carry over into the variables. This happens with other scripts
as well. Scripts with output only (no form variables) work fine. Why would
this be happening?

Chris

chris casey at ev1 dot net
  #2  
Old July 17th, 2005, 05:58 AM
Chris Hope
Guest
 
Posts: n/a
Default Re: PHP config(?) problem

Chris wrote:
[color=blue]
> I'm trying to learn PHP, and I'm having a strange problem with my local
> install on SuSE 9.0. I have a script here:
>
> http://www.little-people-austin.com/~chris/estpop.php
>
> Here, it works fine. When I try to run the same script on my local
> machine, however, I always get "0". I tried a little debug code, and none
> of the form values carry over into the variables. This happens with other
> scripts as well. Scripts with output only (no form variables) work fine.
> Why would this be happening?[/color]

I'm guessing you're trying to access the variables using eg $foo when you
should really be using $_POST['foo'] or $_REQUEST['foo'] (and there's also
the $_GET and $_COOKIE arrays).

Depending on the version of PHP these are not available as $_POST, $_GET etc
but instead as $HTTP_POST_VARS, $HTTP_GET_VARS etc. They changed the
behavior in 4.1.0 but are still available in current versions of PHP.

Check out the manual at
http://www.php.net/manual/en/languag...s.external.php for more info.

Chris

--
Chris Hope
The Electric Toolbox - http://www.electrictoolbox.com/
  #3  
Old July 17th, 2005, 05:58 AM
StinkFinger
Guest
 
Posts: n/a
Default Re: PHP config(?) problem

worked fine here. nice script.

"Chris" <chris@suse.local> wrote in message
news:108p26j9g3mif26@corp.supernews.com...[color=blue]
> I'm trying to learn PHP, and I'm having a strange problem with my local
> install on SuSE 9.0. I have a script here:
>
> http://www.little-people-austin.com/~chris/estpop.php
>
> Here, it works fine. When I try to run the same script on my local
> machine,
> however, I always get "0". I tried a little debug code, and none of the
> form values carry over into the variables. This happens with other scripts
> as well. Scripts with output only (no form variables) work fine. Why would
> this be happening?
>
> Chris
>
> chris casey at ev1 dot net[/color]


  #4  
Old July 17th, 2005, 05:58 AM
Chris
Guest
 
Posts: n/a
Default Re: PHP config(?) problem

Chris wrote:

<snip>

Well, a little digging through the php manual set me straight. I'm using php
4.3.3, while my hosting service is using 4.0.6. The only way I can find to
get my install to act like theirs is to set register_globals = On in the
php.ini file. Either that or hope my hosting service upgrades (virtual
host, not likely).

If anyone has any other ideas, feel free to post.

Thanks to all who replied (or were going to).

Chris
  #5  
Old July 17th, 2005, 05:58 AM
Chris Hope
Guest
 
Posts: n/a
Default Re: PHP config(?) problem

Chris wrote:
[color=blue]
> Chris wrote:
>
> <snip>
>
> Well, a little digging through the php manual set me straight. I'm using
> php 4.3.3, while my hosting service is using 4.0.6. The only way I can
> find to get my install to act like theirs is to set register_globals = On
> in the php.ini file. Either that or hope my hosting service upgrades
> (virtual host, not likely).
>
> If anyone has any other ideas, feel free to post.[/color]

Use $HTTP_POST_VARS['foo'] instead of $foo or $_POST['foo'] and it should
work nicely for both versions. Refer to my other post for more details.

You can also change the value of register_globals in your Apache config file
for a particular virtual host, if you're using Apache with the following
directive in a <virtualhost> section:

php_value register_globals 1

Doing this means you can just change the value for this particular
virtualhost if you are developing for more than one on your dev box.

--
Chris Hope
The Electric Toolbox - http://www.electrictoolbox.com/
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles