php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33022 unable to access $_REQUEST value
Submitted: 2005-05-12 23:24 UTC Modified: 2005-05-21 01:00 UTC
From: juha at mobilememoir dot com Assigned:
Status: No Feedback Package: HTTP related
PHP Version: 4.3.10 OS: Redhat 9 Linux 2.4.20-19.9smp
Private report: No CVE-ID: None
 [2005-05-12 23:24 UTC] juha at mobilememoir dot com
Description:
------------
This bug for unknown reason. Happens approximately 5 times for every 1000 times the script is run. The PHP script where this bug occurs is very complicated so we couldn't figure what encourages this bug to occur. This bug has been bothering us for months. Today we finally gaught it and realized $_REQUEST is the problem. If you run print_r($_REQUEST) key "startqid" is there with its value, but isset($_REQUEST['startqid']) returns false and also if you try to assign "startqid" to a local variable the value will be empty. We fixed this problem simply by replacing $_REQUEST with $_POST, so this is definately a bug in PHP as all $_POST values should exists always in $_REQUEST.

We are using Apache 1.3.33

'./configure' '--with-apxs=/var/apache1333/bin/apxs' '--with-mysql' '--prefix=/var/apache1333/php' '--with-config-file-path=/var/apache1333/php' '--with-imap=/usr/local/imap-2004a' '--with-gd' '--with-png-dir=/usr/include/lib' '--with-zlib-dir=/root/Apache1333/zlib-1.2.1' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/include/freetype2' 

Reproduce code:
---------------
# THIS METHOD DOESN'T
if (isset($_REQUEST('startqid']))
{
    echo "Startqid is coming in ";
    $startqid=$_REQUEST['startqid'];
    echo "($startqid)";
}
else
{
    echo "Startqid not coming in";
}

# THIS METHOD WORKS
if (isset($_POST('startqid']))
{
    echo "Startqid is coming in ";
    $startqid=$_POST['startqid'];
    echo "($startqid)";
}
else
{
    echo "Startqid not coming in";
}

Expected result:
----------------
Startqid is coming in (1)
Startqid is coming in (1)

Actual result:
--------------
Startqid not coming in 
Startqid is coming in (1)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-13 10:00 UTC] sniper@php.net
1. Try with PHP 4.3.11
2. If it fails, check what the variable contains with var_dump($_REQUEST['startqid']);

 [2005-05-21 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC