473,386 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Apache/PHP Post Variables

I'm working with someone on a PHP project. The other person is doing
testing of scripts on their personal machine using Apache as a web server.
The production server and the one I'm using are both using IIS.

This other person reports that in their PHP scripts when tested with Apache,
form variable sent via the POST method are not "coming through." (This is
even using the "long method" of specifying them as $HTTP_POST_VARS['x'].)
These same scripts work fine on the the IIS machine (the POST variable come
through).

I've looked online to see if I can find out if anything special must be
specified in the Apache configuration to enable the POST method, and
although I found other people posting similar problems, I saw no reference
to a solution.

Can anyone tell me what must be done to get this to work as it should with
Apache?

Thanks.

Tony
Jul 17 '05 #1
8 6040
In comp.lang.php Tony <no****@pittarese.com> wrote:
This other person reports that in their PHP scripts when tested with Apache,
form variable sent via the POST method are not "coming through." (This is
even using the "long method" of specifying them as $HTTP_POST_VARS['x'].)
These same scripts work fine on the the IIS machine (the POST variable come
through).


probably there is nothing wrong with your apache setup.
try $_POST['x'] instead of $HTTP_POST_VARS['x'] .
$_POST is a superglobal array, whereas $HTTP_POST_VARS is not.
for more information, see
http://www.php.net/reserved.variables

if this doesn't solve your problem...
which version of PHP are you using? have you inspected the apache log
files for errors?

regards,
steven.
Jul 17 '05 #2
"steven mestdagh" <st*************@esat.kuleuven.REMOVE-THIS.ac.be> wrote in
message news:10***************@seven.kulnet.kuleuven.ac.be ...
In comp.lang.php Tony <no****@pittarese.com> wrote:
This other person reports that in their PHP scripts when tested with Apache, form variable sent via the POST method are not "coming through." (This is even using the "long method" of specifying them as $HTTP_POST_VARS['x'].) These same scripts work fine on the the IIS machine (the POST variable come through).


probably there is nothing wrong with your apache setup.
try $_POST['x'] instead of $HTTP_POST_VARS['x'] .
$_POST is a superglobal array, whereas $HTTP_POST_VARS is not.


I would also suggest print_r($GLOBALS), and see if that reveals anything
interesting.
Jul 17 '05 #3
Joshua Beall wrote:
"steven mestdagh" <st*************@esat.kuleuven.REMOVE-THIS.ac.be> wrote in
message news:10***************@seven.kulnet.kuleuven.ac.be ...
In comp.lang.php Tony <no****@pittarese.com> wrote:
This other person reports that in their PHP scripts when tested with
Apache,
form variable sent via the POST method are not "coming through." (This
is
even using the "long method" of specifying them as
$HTTP_POST_VARS['x'].)
These same scripts work fine on the the IIS machine (the POST variable
come
through).


probably there is nothing wrong with your apache setup.
try $_POST['x'] instead of $HTTP_POST_VARS['x'] .
$_POST is a superglobal array, whereas $HTTP_POST_VARS is not.

I would also suggest print_r($GLOBALS), and see if that reveals anything
interesting.


This sounds like a register_globals problem. Check the PHP.ini file on
the dev machine, and it'll probably show register_globals = off.

Before you change it to "on" however, take a look at:
http://www.php.net/register_globals

I'd go so far as to recommend that your two IIS boxes should probably
have register_globals turned off.

Regards,

- Dan
http://blog.dantripp.com/
Jul 17 '05 #4
"Dan Tripp" <th*******@MyEMailAddress.com> wrote in message news:_oOXb.25623
This sounds like a register_globals problem. Check the PHP.ini file on
the dev machine, and it'll probably show register_globals = off.

Before you change it to "on" however, take a look at:
http://www.php.net/register_globals


Thanks to all those who posted info. Prior to running into this problem I
wasn't well informed about the issues related to the globals. I appreciate
the replies.

Unfortunately, the book I've been using as my primary reference (PHP and
MySQL Web Development by Welling and Thomson) uses $HTTP_POST_VARS in
examples and doesn't explain why this might be a bad thing. (That's 1 of
about 5 problems or errors I've found in my use of this book so far.)

Thanks for all the great info provided.

Tony
Jul 17 '05 #5
I just use the $_REQUEST['variable'] thingy for forms, works for me!
"Tony" <no****@pittarese.com> wrote in message
news:c0********@library2.airnews.net...
"Dan Tripp" <th*******@MyEMailAddress.com> wrote in message news:_oOXb.25623
This sounds like a register_globals problem. Check the PHP.ini file on
the dev machine, and it'll probably show register_globals = off.

Before you change it to "on" however, take a look at:
http://www.php.net/register_globals


Thanks to all those who posted info. Prior to running into this problem I
wasn't well informed about the issues related to the globals. I

appreciate the replies.

Unfortunately, the book I've been using as my primary reference (PHP and
MySQL Web Development by Welling and Thomson) uses $HTTP_POST_VARS in
examples and doesn't explain why this might be a bad thing. (That's 1 of
about 5 problems or errors I've found in my use of this book so far.)

Thanks for all the great info provided.

Tony

Jul 17 '05 #6
"Phillip Parr" <no****@here.com> wrote in
news:jx******************@news-binary.blueyonder.co.uk:
I just use the $_REQUEST['variable'] thingy for forms, works for me!


The problem with $_REQUEST is that what goes into it is determined by
php.ini settings, so it can create portability problems. Also, depending
on those settings, cookie names and environment-variable names wind up
sharing the same namespace as GET and POST parameter names, and may in fact
overwrite them. So it's really appropriate only when you have complete
control over the environment in which PHP is running and don't expect the
code to be moved to any other environment.
Jul 17 '05 #7
"Eric Bohlman" <eb******@earthlink.net> wrote in message
news:Xn*******************************@130.133.1.4 ...
"Phillip Parr" <no****@here.com> wrote in
news:jx******************@news-binary.blueyonder.co.uk:
The problem with $_REQUEST is...

<snip>

Let me summarize for you: Do not use $_REQUEST. It is bad idea. Use $_GET,
$_POST, or $_COOKIE.

;-)

-jb
Jul 17 '05 #8
Ok then. You spoilin all my fun!

"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> wrote in message
news:5I*******************@nwrddc01.gnilink.net...
"Eric Bohlman" <eb******@earthlink.net> wrote in message
news:Xn*******************************@130.133.1.4 ...
"Phillip Parr" <no****@here.com> wrote in
news:jx******************@news-binary.blueyonder.co.uk:
The problem with $_REQUEST is... <snip>

Let me summarize for you: Do not use $_REQUEST. It is bad idea. Use

$_GET, $_POST, or $_COOKIE.

;-)

-jb

Jul 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nick Rees | last post by:
Hi, I've got a strange query that I can't figure out. I've got a new installation of Apache 1.3.28 and PHP 4.3.3 on my laptop, but it doesn't appear to be processing URLs correctly. I've tried...
4
by: Krista | last post by:
Hi everybody, I think my confi has some problems. Can you guys help me to see what is going on? i install Apache2.0.48 and Php4.3.4 in WinXP. I add some codes in httpd(inside apache...
5
by: Vitali Malicky | last post by:
Hello dear All! I need to print out and pass apache evironment variables (like HTTP_HOST, SERVER _NAME, REMOTE_ADDR) to another program which is to process them and take definite actions...
3
by: Jim Johnstone | last post by:
Some details of my HOME PC. I am running the following .... Win2000 SP4; IE V6; 512MB RAM; H/Disk Space OK. In the past couple of weeks I have installed/configured from binaries for .. MySQL...
1
by: Bruce Lehmann | last post by:
Hi, I've installed Apache (WAMP install) so I can edit and test my web site on my home computer. In general php code seems to work, but I can't access Apache variables such as PATH or...
2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
15
by: weissborn | last post by:
I'm a php newbie. I have installed apache 2.0.54 and php 5.0.5 on my win2k box. However, it does not appear the php is working properly. I base this on the following code(which I got from a...
3
by: genenamg | last post by:
Hi, I am trying to run and configure Apache 2.0, php 5 and mysql on win xp professional - this is the first time I have tried to install and configure all three. I am having difficulty trying...
3
by: Leo | last post by:
Can anyone help or offer some explanation with this problem: I'm trying to do a POST from one of my PHP pages, to another page on my site using curl. To maintain the session I'm sending the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.