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 January 22nd, 2004, 04:03 PM
AAA AAA is offline
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with POST and GET

Hi!

I seem to have a problem transferring data by POST & GET from HTML to PHP.

Even the examples I downloaded do not work. (text.html & text.php from chap 3).

I am running RH 9, and at the time of installation I installed Apache with all options.
PHP scripts are working, its only I can't transfer data to them from HTML.

Please offer any suggestions you may have to debug the error.

Thanks!
 
Old January 22nd, 2004, 05:21 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

The problem is likely due to you register_globals setting in php.ini.

To access the data from the form you should use the $_GET or $_POST superglobal arrays..

If you have an input field like so:
<input type='text' name='foo' />

And the method is POST...

Then you would access the variable in
$_POST['foo']

Instead of in $foo..

And $_GET['foo'] if the method is GET.

The default setting for this configuration directive used to be 'on' prior to PHP 4.2.0 and 'off' 4.2.0 onward.. the reasoning behind it being to tighten up security in PHP. The Wrox book was published prior to this configuration's default value being changed. Since PHP no longer encourages its use I would recommend getting used to working with it off. In fact, the directive is deprecated and at some point in the future PHP will no longer support it.

There are a multitude of articles in p2p forums that discuss this..
http://www.google.com/search?q=regis...e:p2p.wrox.com

: )
Rich


:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
 
Old January 25th, 2004, 05:22 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Actually,

A better Google search would be to use an underscore instead of a space:
http://www.google.com/search?q=regis...e:p2p.wrox.com

Finds more articles related to the specific subject... sorry about that!

: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::




Similar Threads
Thread Thread Starter Forum Replies Last Post
Form post page redirect problem - S.O.S. jroxit ASP.NET 1.0 and 1.1 Professional 4 May 21st, 2008 11:06 AM
Cross Page Post Back problem akhilesh_g ASP.NET 2.0 Professional 2 December 24th, 2007 04:38 AM
Post to Another Page problem Indo77 ASP.NET 2.0 Basics 2 March 8th, 2007 05:31 PM
Problem with Cross Page Post Back keaja ASP.NET 2.0 Basics 1 October 31st, 2006 07:00 AM
Problem with using POST method with XMLHTTP vvr Classic ASP XML 1 December 6th, 2004 01:44 AM





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