473,662 Members | 2,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

$_POST getting lost, $GLOBALS['HTTP_RAW_POST_ DATA'] is still set

Hi All,

I cannot turn off magic quotes, since I am just leasing space from a hosting
company, and they determine the magic_quotes settings. I realize in
retrospect that using a .htaccess file to turn magic quotes would probably
be better, and I am going to switch to that solution, but I am still trying
to figure out what is causing my current problem:

I am using the following code to automatically strip out any slashes that
were added automagically by gpc_magic_quote s:

$_POST = array_stripslas hes($_POST);

// Takes the passed array, and strips and escaping slashes out of
any strings in the array.
// This is a recursive function capable of handling multidimensiona l
arrays
function array_stripslas hes($data)
{
do{
$pair = each($data); // Get the next key-value
pair from the array
if($pair === false)
break;
$key = $pair[0]; // This is just for
readability
$val = $pair[1];
if(is_array($va l))
$val = Utility::array_ stripslashes($v al);
elseif(is_strin g($val))
$val = stripslashes($v al);
$data[$key] = $val;
}while(true);
return $data;
}

Now, I test it several times and it appears to be working fine. But, I just
got an error report from a user, with agent "Mozilla/4.0 (compatible; MSIE
5.0; CS 2000 6.0; Windows 98; DigExt)", and when they clicked on a submit
button, all the POST data was lost. Interestingly enough,
$GLOBALS['HTTP_RAW_POST_ DATA'] was populated with all the form fields I
would have expected to be in $_POST (although raw, of course, not parsed
into variables).

Is my code broken? Or is this a bug in PHP? Or what?

Sincerely,
-Josh
Jul 17 '05 #1
0 2001

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

Similar topics

4
13999
by: Marc Lambrichs | last post by:
We receive a POST message being a multipart/mixed type. The $HTTP_RAW_POST_DATA shows it perfectly. However, I expected the $_POST to be filled as well, which is empty. We're using php 4.3.3. Any ideas? Thx. Marc
6
2653
by: Phil Powell | last post by:
I have an inherited class method that is required to *only* handle items from $_POST (and $_POST alone, for security reasons), for validation and action processing. Problem is that there is a section in my application that has to put everything into an encoded query string for HTML reasons (the page is a giant form and if I were to put the stuff into individual forms, I would have a bunch of embedded forms inside one form and that is an...
14
4327
by: billy.becker | last post by:
I need to save a wav file that is HTTP POSTed to a php page. What does PHP5 do automatically to a POSTed variable when it puts it in the $_POST superglobal array? I haven't been able to find any info on this.... I have a script that does what I want in PERL, but I need to do it in PHP. I think the PERL does something magic when it does this:
1
2081
by: Takashi | last post by:
Anyone know what this constant is for (Google searches are not bringing anything that directly answers the question - what is it used for?)
13
5214
by: comp.lang.php | last post by:
Other: <input name="school_type_other" size="30" maxlength="75" value="<?php if ($_POST) echo $_POST; else echo str_replace('"', '&quot;', str_replace('\\', '', $result->school_type_other)); ?>">
7
2483
by: Dynamo | last post by:
I am using values stored an $_POST array to display records from a table before asking the user if he is sure he wants to delete them. If the user confirms then the records are deleted. Without boring you with all of the code here is the rough idea. <?php $delete = '( id = ' . implode(' OR id = ', $_POST ) . ' ) '; if (!isset($_POST)) { // Then display the records that were marked for deletion ?>
2
2855
by: Egbert Teeselink | last post by:
Hi there, I'm trying to process a form that I got from a JSP generated page. Basically, want to take out and process some of the data, and redirect the rest to a JSP page that will handle the rest. All works well, i traverse $_POST, writeout hidden input fields and autosubmit the form with a little javascript, a perfectly acceptable solution for our users. However, the data the JSP page sends contains one certain input with the same...
21
20691
tpaine
by: tpaine | last post by:
Let me preface this by saying that this is most certainly not a code issue but a config issue. I have been able to implement the code fine on my live server, this problem only occurs on my localhost. I have 7 years experience with various web langauges so we can skip the "METHOD='POST'" comments. I recently setup PHP and Apache (and mySQL) on my windows XP box. This is my first experience with PHP and it took me a long time to get everything...
12
2653
by: Todd Michels | last post by:
Hi all, I am trying to send data from a form and insert it into a MSSQL DB. When I submit the data I get: Warning: mssql_query() : message: The name "Todd" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted. (severity 15) in "Myfile"
0
8435
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.