#24753 [Opn->Fbk]: missing character in POST data

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default #24753 [Opn->Fbk]: missing character in POST data

    ID: 24753
    Updated by: [email]iliaa@php.net[/email]
    Reported By: robin at newloop dot com
    -Status: Open
    +Status: Feedback
    Bug Type: HTTP related
    Operating System: Win XP Pro 2002 SP1
    PHP Version: 4.3.2
    New Comment:

    Please try using this CVS snapshot:

    [url]http://snaps.php.net/php4-STABLE-latest.tar.gz[/url]

    For Windows:

    [url]http://snaps.php.net/win32/php4-win32-STABLE-latest.zip[/url]




    Previous Comments:
    ------------------------------------------------------------------------

    [2003-07-22 09:32:23] robin at newloop dot com

    Description:
    ------------
    On requesting POST data using $_POST or $_REQUEST that
    is being sent using Macromedia Flash MX, the last
    character of the last request is missing. Work around
    is to send a dummy variable as the last request.

    Reproduce code:
    ---------------
    <?
    $filePath = stripslashes($_REQUEST["cmsFilePath"]);
    $fileDataTotal = stripslashes($_REQUEST["cmsFileDataTotal"]);
    $fileData = " ";
    for ($counter = 0; $counter < $fileDataTotal; $counter ++){
    $newPart = stripslashes($_REQUEST["cmsFileData".$counter]);
    $fileData = $fileData.$newPart;
    }
    $fileName = stripslashes($_REQUEST["cmsFileName"]);
    $test = stripslashes($_REQUEST["cmstest"]);
    $start = time();
    while (time()<($start +5)) {
    }
    $tfile = $filePath."/".$fileName;
    touch($tfile);
    chmod($tfile, 0666);
    $handle = fopen($tfile, "wb");
    fwrite($handle, $fileData.$test);
    fclose($handle);
    ?>

    Expected result:
    ----------------
    the $test variable should contain the string "hello"

    Actual result:
    --------------
    the $test variable actually contains "hell"
    All other variables are ok.


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=24753&edit=1[/url]

    iliaa@php.net Guest

  2. Similar Questions and Discussions

    1. #24753 [Opn]: missing character in POST data
      ID: 24753 User updated by: robin at newloop dot com Reported By: robin at newloop dot com Status: Open Bug Type: ...
    2. #24753 [Bgs->Opn]: missing character in POST data
      ID: 24753 User updated by: robin at newloop dot com Reported By: robin at newloop dot com -Status: Bogus +Status: ...
    3. #24753 [Opn->Bgs]: missing character in POST data
      ID: 24753 Updated by: derick@php.net Reported By: robin at newloop dot com -Status: Open +Status: ...
    4. #24753 [Fbk->Opn]: missing character in POST data
      ID: 24753 User updated by: robin at newloop dot com Reported By: robin at newloop dot com -Status: Feedback...
    5. #24753 [NEW]: missing character in POST data
      From: robin at newloop dot com Operating system: Win XP Pro 2002 SP1 PHP version: 4.3.2 PHP Bug Type: HTTP related Bug...
  3. #2

    Default #24753 [Opn->Fbk]: missing character in POST data

    ID: 24753
    Updated by: [email]iliaa@php.net[/email]
    Reported By: robin at newloop dot com
    -Status: Open
    +Status: Feedback
    Bug Type: HTTP related
    Operating System: Win XP Pro 2002 SP1
    PHP Version: 4.3.2
    New Comment:

    <?php
    var_dump(ini_get("register_globabls"));
    ?>
    Will tell you if you have register_globals enabled.

    As for the space, make sure you have no spaces before the <?php (or <?)
    in your script.


    Previous Comments:
    ------------------------------------------------------------------------

    [2003-07-22 11:47:05] robin at newloop dot com

    thanks for your help on this;
    1) I am using it as CGI already.
    2) The first charater is present and correct. I am
    getting an un-asked-for " " at the beginning of my
    file, though.
    3) Not sure about this. I haven't been using PHP for
    very long. how can I check for it?

    ------------------------------------------------------------------------

    [2003-07-22 11:14:24] [email]iliaa@php.net[/email]

    1) Are you using as isapi module or CGI, if you are using the isapi
    module try CGI and see if the problem persists.
    2) Is the 1st character of the last variable missing when you use
    $_POST?
    3) Do you have register_globals enabled or disabled?

    ------------------------------------------------------------------------

    [2003-07-22 10:26:03] robin at newloop dot com

    have just tried this but seems to make no difference.
    Any ideas? It's IIS 5.1 if that helps.

    ------------------------------------------------------------------------

    [2003-07-22 09:43:10] [email]iliaa@php.net[/email]

    Please try using this CVS snapshot:

    [url]http://snaps.php.net/php4-STABLE-latest.tar.gz[/url]

    For Windows:

    [url]http://snaps.php.net/win32/php4-win32-STABLE-latest.zip[/url]



    ------------------------------------------------------------------------

    [2003-07-22 09:32:23] robin at newloop dot com

    Description:
    ------------
    On requesting POST data using $_POST or $_REQUEST that
    is being sent using Macromedia Flash MX, the last
    character of the last request is missing. Work around
    is to send a dummy variable as the last request.

    Reproduce code:
    ---------------
    <?
    $filePath = stripslashes($_REQUEST["cmsFilePath"]);
    $fileDataTotal = stripslashes($_REQUEST["cmsFileDataTotal"]);
    $fileData = " ";
    for ($counter = 0; $counter < $fileDataTotal; $counter ++){
    $newPart = stripslashes($_REQUEST["cmsFileData".$counter]);
    $fileData = $fileData.$newPart;
    }
    $fileName = stripslashes($_REQUEST["cmsFileName"]);
    $test = stripslashes($_REQUEST["cmstest"]);
    $start = time();
    while (time()<($start +5)) {
    }
    $tfile = $filePath."/".$fileName;
    touch($tfile);
    chmod($tfile, 0666);
    $handle = fopen($tfile, "wb");
    fwrite($handle, $fileData.$test);
    fclose($handle);
    ?>

    Expected result:
    ----------------
    the $test variable should contain the string "hello"

    Actual result:
    --------------
    the $test variable actually contains "hell"
    All other variables are ok.


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=24753&edit=1[/url]

    iliaa@php.net Guest

  4. #3

    Default #24753 [Opn->Fbk]: missing character in POST data

    ID: 24753
    Updated by: [email]iliaa@php.net[/email]
    Reported By: robin at newloop dot com
    -Status: Open
    +Status: Feedback
    Bug Type: HTTP related
    Operating System: Win XP Pro 2002 SP1
    PHP Version: 4.3.2
    New Comment:

    Try to make a simple script just to see if the bug is particular to the
    script you are using or any POST request. I find it extremely unusual
    that _POST contains correct data while _REQUEST does not, since
    _REQUEST is built using data from _POST.


    Previous Comments:
    ------------------------------------------------------------------------

    [2003-07-22 12:33:30] robin at newloop dot com

    no, still open. That Doh! was for something else.

    There is still a problem with the last POST variable
    requested missing it's last character.

    I could, of course just add an extra character, or
    dummy variable, but I'd rather know if I'm working
    around a feature or a bug, or if I'm simply doing
    something wrong?

    ------------------------------------------------------------------------

    [2003-07-22 12:24:40] [email]derick@php.net[/email]

    Bogus then :)

    ------------------------------------------------------------------------

    [2003-07-22 12:10:01] robin at newloop dot com

    again, big thanks!
    register globals is Off

    Worked out the space thing. Doh!
    had a line specifically adding it:
    $fileData = " ";

    ------------------------------------------------------------------------

    [2003-07-22 11:50:16] [email]iliaa@php.net[/email]

    <?php
    var_dump(ini_get("register_globabls"));
    ?>
    Will tell you if you have register_globals enabled.

    As for the space, make sure you have no spaces before the <?php (or <?)
    in your script.

    ------------------------------------------------------------------------

    [2003-07-22 11:47:05] robin at newloop dot com

    thanks for your help on this;
    1) I am using it as CGI already.
    2) The first charater is present and correct. I am
    getting an un-asked-for " " at the beginning of my
    file, though.
    3) Not sure about this. I haven't been using PHP for
    very long. how can I check for it?

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/24753[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=24753&edit=1[/url]

    iliaa@php.net Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139