?
Solved

POST data being mangled during POST operations under Apache

Posted on 2003-11-26
3
Medium Priority
?
260 Views
Last Modified: 2010-04-20
Hi everyone.  I'm offering up 500 points for this one as it's got me completely and utterly stumped, and I need a solution.  I'm going to be very stringent in awarding these points, as the solution must work completely.  First person to solve it completely gets 500 points.

This is the situation:

I'm running Apache 2.0 with PHP 4.2.2 on a Dell Precision 340 running RedHat 9.

I've been writing a Content Management System for some time now, and I've recently noticed something strange happening, and it's only happened since I moved development of the CMS from a temporary server to my workstation (temporarily until a permanent home for the CMS is acquired here).

At times when I'm attempting to update data within the CMS (say, a stylesheet snippet, content block, etc.) when I submit the form the POST operation mangles the code.

That is to say, it's taking some of the original code, and appending it to the end of the complete block of the original code.

Here's an example of the good input:  http://web.unbc.ca/~gossep/good_code.txt

And here's an example of the garbage output:  http://web.unbc.ca/~gossep/bad_code.txt

Additionally, the mangling of the code is slightly different depending on which browser you try this with.

As you can see, part of the POSTed code has been appended to the end of the original code.  This is not happening with all code, but only with certain snippets.  The one common thing I've been able to pinpoint it to is perhaps the length of the code segment in question.  I unfortunately do not have time to built a POSTed piece of code one character at a time to figure out if this is indeed the case.

Additionally, this seems to also happen with images that are uploaded via the CMS as well.

To see how it mangles some of the images, please view the images at http://web.unbc.ca/~gossep/sample_images/.  The images which were mangled are named [filename]_uploaded.ext so you can see the originals and the mangled images.

My initial thoughts were that it must be something in my code, but that's simply not the case.  For both text posts and image uploads I created bare-bones forms (nothing more than the form tags, a textarea and submit button for the former, and the form tags, file input and upload button for the latter) and on my machine the problem still occurs but on others it does not.

I'm not overly concerened that this will be a problem in the long run, since the CMS will be going to its permanent home within the next couple of months, and I've run a number of tests on other workstations and these problems do not occur.

However, right now it's proving very difficult for me in development, since I will often need to make changes to a template or other code chunk, in which case I need to copy the code from the CMS to notepad (the CMS requires IE5.5 so I'm accessing it via our tss box) escape all necessary characters and then copy it into a manual sql query.

I look forward to replies to this problem.

GOOD LUCK!

Cheers,
Pablo Gosse
0
Comment
Question by:pablogosse
1 Comment
 
LVL 2

Accepted Solution

by:
JClawson earned 2000 total points
ID: 10806430
That is quite a strange problem... .Assuming your code is correct, it sounds like somthing is wrong in either apache or PHP.  Perhaps a file was somhow corrupted... who knows.  First I would suggest updating PHP to 4.3.5 or 4.3.6.  Hopefully this will fix it.  If that doesn't work ty reinstalling apache... or vice-versa.  I imagine a fresh reinstall should fix it.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month13 days, 16 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question