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
  #1 (permalink)  
Old August 12th, 2003, 12:28 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default POST method not working

Dear Experts,

I have created a form to print a value name field.

<?
if(isset($_GET['submit'])) {

    print("<br>");
    print($_GET["name"]);

}
else
{
    print("<br>not submitted");
}
?>

I'm using GET method here, but I dont want to use GET method but want to use POST method instead.

When changed to POST method it is giving error Undefined index

register_globals is set to OFF
request_method is set to GET

How do I change the request method to POST?

Please help.

regards,
ganesh

  #2 (permalink)  
Old August 12th, 2003, 03:15 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Moharo
Default

check if you have specified the submit method in your form (<form method="post" action="any.php">)

then rewrite the code to:

<?
if(isset($_POST["submit"]) && isset ($_POST["name"])) {
     print("<br>");
     print($_POST["name"]);

}

else print ("<br>not submitted");
?>

i think this should work

:D:D:D:D

the genuine genius
  #3 (permalink)  
Old February 18th, 2006, 08:35 AM
Registered User
 
Join Date: Jan 2006
Location: Mumbai, , India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i m facing similar problem.
$_GET method works fine
$_POST is not working

Ashraf Ahmed


Similar Threads
Thread Thread Starter Forum Replies Last Post
post method franta1346 Reporting Services 0 July 22nd, 2007 11:08 PM
using post method urgently skyman763 General .NET 0 February 13th, 2005 10:42 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
POST method not working in LINUX Server , but work cnilashis Beginning PHP 2 August 19th, 2003 08:13 AM





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