FC2, FC1 httpd/php not processing in-line parameter
Gerry Tool
gstool at earthlink.net
Wed Jun 23 03:34:51 UTC 2004
Scot L. Harris wrote:
> On Tue, 2004-06-22 at 21:53, Gerry Tool wrote:
>
>>I have httpd, mysqld and php running fine on my FC2 and FC1 systems.
>>
>>A test web page that follows always prints ID passed = 0 regardless of
>>the parameter put in the URL, i.e., http://localhost/testpassparam.php?id=2
>>still results in 0.
>>
>>Test page:
>>==========
>><html>
>>
>><body>
>>
>><?php
>>
>>printf("ID passed = %d\n", $id);
>>
>>?>
>>
>></body>
>>
>></html>
>>========
>>This same test works fine on a Mandrake 10.0 Official installation on
>>this same computer, giving the result of whatever is included in the
>>URL, as well as on a web site I manage on a virtual server provided by
>>an ISP.
>>
>>Can others verify this? Is it a known bug? I looked in bugzilla and
>>did not find this particular problem.
>>
>>Thanks.
>>
>>Gerry Tool
>
>
> Usually when a problem like this comes up global vars are probably on in
> the old systems and off in the new system.
>
> You will need to use something like
>
> $value = $HTTP_POST_VARS[variable]
>
> to get the variable that was passed from the form. Assumes you used
> post in the form. It would be $HTTP_GET_VARS[variable] if you used get
> in the form.
>
> For php is best to have global vars turned off. It does mean you have
> to modify how you write your code. But it does improve your security on
> the server.
>
> Hope that helps.
>
Yes it does. The $HTTP_GET_VARS[variable] works. Thanks for the
suggestion and the explanation. I'll have to fix up some former sloppiness.
Gerry
More information about the fedora-list
mailing list