RE: [PHP] newbie problem working with Forms - undefined constant?
| From: | Lawrence dot Sheed at dfait-maeci dot gc dot ca | Date: | Wed, 15 Nov 2000 10:00:58 +0000 |
| Subject: | RE: [PHP] newbie problem working with Forms - undefined constant? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-25404@lists.php.net to get a copy of this message | ||
Problem 2 you have
form variables are passed back as
$name
So if your form contains
<input name="stuff" value="">
The PHP variable will be $stuff
Not Form[stuff]
This is probably tripping you up.
Another thing to watch out for is precedence of Get, Post, Cookie,
Environment variables.
eg if you have a cookie called $cutter, and a get or post variable (from a
form) called $cutter, which takes precedence?
You're php setup will show you. Do a <?php phpinfo()?> and look.
I usually do an explicit
if (isset($HTTP_GET_VARS))
{
while(list($name,$value) = each($HTTP_GET_VARS))
{
$$name = $value;
};
};
But this is probably going to be confusing for you until you've got the hang
of it...
Cheers,
Loz.
-----Original Message-----
From: Philip Lindsay [mailto:phil@presence-multimedia.co.uk]
Sent: November 15, 2000 05:51 PM
To: PHP list
Subject: [PHP] newbie problem working with Forms - undefined constant?
Hi,
I've really only been using PHP for three weeks though so bear with me if
this sounds a bit daft.
I have some scripts which piece together to build a message board with a
mysql database. The scripts come from the SAMS book - Teach Yourself PHP in
24 hours (ch. 23).
On one of the pages is a form which extracts the users details and logs them
into the database when they join - but I receive errors such as :
Warning: Use of undefined constant password - assumed 'password' in
c:\program files\apache group\apache\htdocs\mysql\join.php on line 11
I have the value of each input box as form[login], form[password] etc.. and
it seems to be tripping over these. Can anyone shed any light on this
problem? I can send the code if it may help?
Cheers in advance,
Phil
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net