• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

PHP $_POST problem in apache php. Posting more than 10 characters doesnt work

GoodEvening.

We are just about to go live in our new VPS server, unfortunately we have a VERY frustrating problem.

The VPS just got upgraded to PHP ver 5.2.5, and since then HTTP POST does not work as expected. As you can understand it completely breaks our application.

We have identified the problem and is seems to be related to the configuration of either apache (httpd.conf) or php (php.ini).

The problem:
You have an HTML form with a text input field. If you enter 10 characters (0123456789) it gets posted ok, and PHP reads the _POST variable. If you post more than 10 characters (01234567891) php doesnt read the variable.


Thank you in advance.


<?php
error_reporting(E_ALL);
echo $_POST['text1'];
?>
<html>
<head>
<title></title>
</head>
<body>
<form method="post" action="broken.php">
<input type="text" name="text1">
<input type="submit" value="Send">
</form>
</body>
</html>

Open in new window

0
heckyEXPERT
Asked:
heckyEXPERT
1 Solution
 
Sander StadSysteemontwikkelaar, Database AdministratorCommented:
Can you try to set the output_buffering tothe following in the php.ini:
 

output_buffering = On

Open in new window

0
 
heckyEXPERTAuthor Commented:
Sstad, I did it , restarted the server, problem persists. No change
0
 
AielloJCommented:
I'm wondering if the unspecified length of your text1 field is using some default in the PHP interpreter.  Try assigning size and maxlength attributes and see if it helps.

<input type="text" name="text1" size="25" maxlength="25">

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
heckyEXPERTAuthor Commented:
AielloJ thank you for your input. Unfortunately the problem still persists.

In fact, I've contacted Tier 1 tech support on my VPS host and they gave the problem a try. The support technician "made some changes" as he told me. Now the limit has gone from 10 characters to only 2 characters. They've propagated the problem to Tier 2.

0
 
cristidesCommented:
Notice: Undefined index: text1 in tst.php on line 3 , i think you want to autocomplete to text1 if not, you must to change from _POST to _GET
0
 
AielloJCommented:
heckyEXPERT:

I'd be interested in what the solution is when you get it.  Nothing to put your mind at ease like the "improvements" in the condition from tech support!! LOL  Seriously though, it seems like tech support is playing around in the right neighborhood if they were able to affect the problem.
0
 
heckyEXPERTAuthor Commented:
AielloJ,

When the solution comes in from tech support , assuming they are not to embarrassed as to explaining the source and the fix of the problem, i will post it here.

As an aside, its funny how things like that can hold of a commercial project from going live for a number of days. I guess a VPS is still a VPS, and however "isolated" and "complete root access" you have, you still have a box within another box, and there are always some cpanel/virtuozo application running messing up your config files without your knowledge.
0
 
AielloJCommented:
heckyEXPERT:

I agree.  From the business and operations side, most companies have a moratorium on any IT platform and software changes at critical times in their business cycle.  Like tax season if you're an accounting firm, etc.  If your using a VPS within your company, there should be a formal upgrade process that contains a "backout plan" at each step of the process that details how to return to the prior condition if the upgrade fails.  If your VPS is owned and managed by an outside firm, the Service Level Agreement should require your firms agreement to the scheduling of major revisions & changes.  Don't know if either of these are applicable in your case, but if they are you can take them to management and possibly get the rules implemented, or other resources needed budgeted.

JRA
0
 
heckyEXPERTAuthor Commented:
Problem was fixed.. (not by my tech support, still waiting for their communication).

All i did was get a fresh php.ini.recommended from the latest php distro and made some small changes to reflect my VPS setup (location of php module etc)

Thanks everyone for their input
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now