Solved

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

Posted on 2008-10-24
9
257 Views
Last Modified: 2013-12-13
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
Comment
Question by:heckyEXPERT
[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
9 Comments
 
LVL 9

Expert Comment

by:Sander Stad
ID: 22795097
Can you try to set the output_buffering tothe following in the php.ini:
 

output_buffering = On

Open in new window

0
 

Author Comment

by:heckyEXPERT
ID: 22795154
Sstad, I did it , restarted the server, problem persists. No change
0
 
LVL 13

Expert Comment

by:AielloJ
ID: 22795925
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:heckyEXPERT
ID: 22795972
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
 
LVL 1

Expert Comment

by:cristides
ID: 22795982
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
 
LVL 13

Expert Comment

by:AielloJ
ID: 22796046
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
 

Author Comment

by:heckyEXPERT
ID: 22796092
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
 
LVL 13

Expert Comment

by:AielloJ
ID: 22796466
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
 

Accepted Solution

by:
heckyEXPERT earned 0 total points
ID: 22804146
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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

717 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