Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 4th, 2004, 07:41 AM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default POST method behave strangely

Hello,

I am using a Linux Red Hat OS + PHP 4.3.0 + Apache

I got a problem with HTML form and PHP POST method wich work strangely.

<form action="b.php" method="post">
     <input name="entry1" type="text">
     <input value="GO" type="submit">
</form>

In the 'b.php' script i do :
<?
echo "\$_POST['entry1'] = {$_POST['entry1']} <br>";
?>

the result is (i typed '42' as the value to display) :
$_POST['entry1'] = 42Entry1=42; //it glues both variable name+value

It does works well with GET method, but not with POST. The phpinfo() method shows that the _POST variable =>'42Entrey1=42'<= and that the QUERY_STRING variable is empty (wich is not true with the GET method wich works properly)...

What's wrong ?
Thank you
 
Old May 4th, 2004, 12:23 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I have never heard of this happening. Try this (although I believe your code should work; maybe it's a bug of PHP 4.3.0):

echo "\$_POST['entry1'] = " . $_POST['entry1'] . "<BR>";

HTH,

Snib

<><




Similar Threads
Thread Thread Starter Forum Replies Last Post
post method franta1346 Reporting Services 0 July 22nd, 2007 11:08 PM
Post Method Error spitz Classic ASP Databases 2 June 10th, 2005 04:31 AM
using post method urgently skyman763 General .NET 0 February 13th, 2005 10:43 AM
about post and get method csc820203 HTML Code Clinic 1 August 2nd, 2004 01:13 PM
Post Method? zhenwe1 Servlets 0 January 25th, 2004 01:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.