You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Vikas Chowdhry <vc...@cs.uic.edu> on 2002/11/06 20:24:30 UTC

[users@httpd] Cannot get query string to work

Hi

I am a newbie to apache server administration. I have recently configured
apache server on my Red Hat 8.0 system. I am using it to run two virtual
hosts, one on the IP address provided by my ISP and the other one on my
internal LAN.

The server is serving web pages nicely but recently I tried to enhance my
website by getting some user feedback using forms. I am using PHP on the
server side. The problem is that the values of the variables in the query
string are not getting passed to the PHP script. I know that the PHP
script is running fine because I am able to assign values to variables
inside the script and display them. But the variables that get passed onto
from the form are getting null values. I have tried both GET and POST and
I have also tried giving the query string directly in the URL to the
script but nothing is working.

It may have to do with some settings that I need to tweak in the
httpd.conf because I set up the server using the GUI tool that Red Hat has
provided in its version 8.

Any help would be greatly appreciated.

Thanks

Vikas


---------------------------------------------------------------------
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] Cannot get query string to work

Posted by John Burski <jb...@cloudnet.com>.
You could also try editing the "php.ini" file.  Change the 
"register_globals" value from "Off" to "On".

You'll have to restart Apache after you make the change.

Caveat:  This has some security issues, and only you can decide whether 
or not this choice is prudent in your situation.

Jonathan Villa wrote:

>Try this.
>
>After the form submits, 
>
>
>$your_var = $_REQUEST['your_var'];
>
>or $tmp_var = $_REQUEST['your_var'];
>
>Do that for all your variables after the page submits.
>
>-----Original Message-----
>From: Vikas Chowdhry [mailto:vchowdhr@cs.uic.edu] 
>Sent: Wednesday, November 06, 2002 1:25 PM
>To: users@httpd.apache.org
>Subject: [users@httpd] Cannot get query string to work
>
>Hi
>
>I am a newbie to apache server administration. I have recently
>configured
>apache server on my Red Hat 8.0 system. I am using it to run two virtual
>hosts, one on the IP address provided by my ISP and the other one on my
>internal LAN.
>
>The server is serving web pages nicely but recently I tried to enhance
>my
>website by getting some user feedback using forms. I am using PHP on the
>server side. The problem is that the values of the variables in the
>query
>string are not getting passed to the PHP script. I know that the PHP
>script is running fine because I am able to assign values to variables
>inside the script and display them. But the variables that get passed
>onto
>from the form are getting null values. I have tried both GET and POST
>and
>I have also tried giving the query string directly in the URL to the
>script but nothing is working.
>
>It may have to do with some settings that I need to tweak in the
>httpd.conf because I set up the server using the GUI tool that Red Hat
>has
>provided in its version 8.
>
>Any help would be greatly appreciated.
>
>Thanks
>
>Vikas
>
>
>---------------------------------------------------------------------
>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
>
>
>
>---------------------------------------------------------------------
>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
>
>.
>
>  
>

-- 
John Burski
@home S.I.M.U. (Well, sometimes I am)

... and still searching for new cheese




---------------------------------------------------------------------
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] Cannot get query string to work

Posted by Jonathan Villa <ap...@ftbwebsolutions.com>.
Vikas, 

This is because you are using a newer version of PHP. The recent
versions of Apache (> 4.1) have this documented in the php.ini file.  

If you want to avoid doing this just set register_globals = On in the
php.ini

But I wouldn't advise that.  I would just get used to using the new
methods.  

-Jonathan

-----Original Message-----
From: Vikas Chowdhry [mailto:vchowdhr@cs.uic.edu] 
Sent: Wednesday, November 06, 2002 1:38 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Cannot get query string to work

Wow!! Thanks a lot Jonathan....that simply worked. I have been trying
the
whole night to get it going thinking that I am doing some screwup in
Apache setting. 

I know I am new to this so this may sound foolish but is this a hack you
discovered or is this documented somewhere? I ask this because none of
the
sites that teach PHP/mysql/apache programming have this documented.

Thanks

Vikas

On Wed, 6 Nov 2002, Jonathan Villa wrote:

> Try this.
> 
> After the form submits, 
> 
> 
> $your_var = $_REQUEST['your_var'];
> 
> or $tmp_var = $_REQUEST['your_var'];
> 
> Do that for all your variables after the page submits.
> 
> -----Original Message-----
> From: Vikas Chowdhry [mailto:vchowdhr@cs.uic.edu] 
> Sent: Wednesday, November 06, 2002 1:25 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] Cannot get query string to work
> 
> Hi
> 
> I am a newbie to apache server administration. I have recently
> configured
> apache server on my Red Hat 8.0 system. I am using it to run two
virtual
> hosts, one on the IP address provided by my ISP and the other one on
my
> internal LAN.
> 
> The server is serving web pages nicely but recently I tried to enhance
> my
> website by getting some user feedback using forms. I am using PHP on
the
> server side. The problem is that the values of the variables in the
> query
> string are not getting passed to the PHP script. I know that the PHP
> script is running fine because I am able to assign values to variables
> inside the script and display them. But the variables that get passed
> onto
> from the form are getting null values. I have tried both GET and POST
> and
> I have also tried giving the query string directly in the URL to the
> script but nothing is working.
> 
> It may have to do with some settings that I need to tweak in the
> httpd.conf because I set up the server using the GUI tool that Red Hat
> has
> provided in its version 8.
> 
> Any help would be greatly appreciated.
> 
> Thanks
> 
> Vikas
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 


---------------------------------------------------------------------
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] Cannot get query string to work

Posted by Vikas Chowdhry <vc...@cs.uic.edu>.
Wow!! Thanks a lot Jonathan....that simply worked. I have been trying the
whole night to get it going thinking that I am doing some screwup in
Apache setting. 

I know I am new to this so this may sound foolish but is this a hack you
discovered or is this documented somewhere? I ask this because none of the
sites that teach PHP/mysql/apache programming have this documented.

Thanks

Vikas

On Wed, 6 Nov 2002, Jonathan Villa wrote:

> Try this.
> 
> After the form submits, 
> 
> 
> $your_var = $_REQUEST['your_var'];
> 
> or $tmp_var = $_REQUEST['your_var'];
> 
> Do that for all your variables after the page submits.
> 
> -----Original Message-----
> From: Vikas Chowdhry [mailto:vchowdhr@cs.uic.edu] 
> Sent: Wednesday, November 06, 2002 1:25 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] Cannot get query string to work
> 
> Hi
> 
> I am a newbie to apache server administration. I have recently
> configured
> apache server on my Red Hat 8.0 system. I am using it to run two virtual
> hosts, one on the IP address provided by my ISP and the other one on my
> internal LAN.
> 
> The server is serving web pages nicely but recently I tried to enhance
> my
> website by getting some user feedback using forms. I am using PHP on the
> server side. The problem is that the values of the variables in the
> query
> string are not getting passed to the PHP script. I know that the PHP
> script is running fine because I am able to assign values to variables
> inside the script and display them. But the variables that get passed
> onto
> from the form are getting null values. I have tried both GET and POST
> and
> I have also tried giving the query string directly in the URL to the
> script but nothing is working.
> 
> It may have to do with some settings that I need to tweak in the
> httpd.conf because I set up the server using the GUI tool that Red Hat
> has
> provided in its version 8.
> 
> Any help would be greatly appreciated.
> 
> Thanks
> 
> Vikas
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 


---------------------------------------------------------------------
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] Cannot get query string to work

Posted by Jonathan Villa <ap...@ftbwebsolutions.com>.
Try this.

After the form submits, 


$your_var = $_REQUEST['your_var'];

or $tmp_var = $_REQUEST['your_var'];

Do that for all your variables after the page submits.

-----Original Message-----
From: Vikas Chowdhry [mailto:vchowdhr@cs.uic.edu] 
Sent: Wednesday, November 06, 2002 1:25 PM
To: users@httpd.apache.org
Subject: [users@httpd] Cannot get query string to work

Hi

I am a newbie to apache server administration. I have recently
configured
apache server on my Red Hat 8.0 system. I am using it to run two virtual
hosts, one on the IP address provided by my ISP and the other one on my
internal LAN.

The server is serving web pages nicely but recently I tried to enhance
my
website by getting some user feedback using forms. I am using PHP on the
server side. The problem is that the values of the variables in the
query
string are not getting passed to the PHP script. I know that the PHP
script is running fine because I am able to assign values to variables
inside the script and display them. But the variables that get passed
onto
from the form are getting null values. I have tried both GET and POST
and
I have also tried giving the query string directly in the URL to the
script but nothing is working.

It may have to do with some settings that I need to tweak in the
httpd.conf because I set up the server using the GUI tool that Red Hat
has
provided in its version 8.

Any help would be greatly appreciated.

Thanks

Vikas


---------------------------------------------------------------------
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



---------------------------------------------------------------------
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