Solved

POST data being mangled during POST operations under Apache

Posted on 2003-11-26
3
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
JClawson earned 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 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