RE: [PHP-INSTALL] Persistant Undefined Index Error with php/mysql
| From: | Hari Bhanujan | Date: | Sat, 03 Jul 2004 14:14:04 +0000 |
| Subject: | RE: [PHP-INSTALL] Persistant Undefined Index Error with php/mysql | ||
| References: | 1 | Groups: | php.install |
| Request: | Send a blank email to php-install+get-13795@lists.php.net to get a copy of this message | ||
Instead of straight passing through to the variable,
Use a sql statement
$s=" Select first_name...from";
$s.=" ..";
Once this is done
Use an array to store values selected
Eg :
$firstname='first_name'
echo $firstname..
see if this works
-----Original Message-----
From: Monique Verrier [mailto:monique@costill.com]
Sent: Saturday, July 03, 2004 12:45 AM
To: php-install@lists.php.net
Subject: [PHP-INSTALL] Persistant Undefined Index Error with php/mysql
Hi!
I am hoping that someone can be of help. I think that there may be a
problem with my installation because I'm getting the same error with a
tutorial I'm working on and some software I tried to install. I keep
getting the undefined index error. Does anyone have any suggestions?
Thanks so much!
Monique.
Here is the code:
<?
include 'db.php';
// Define post fields into simple variables
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email_address = $_POST['email_address'];
$username = $_POST['username'];
$info = $_POST['info'];
.............etc.
Here are the errors:
Notice: Undefined index: first_name in
c:\inetpub\wwwroot\mem\register.php
on line 6
Notice: Undefined index: last_name in
c:\inetpub\wwwroot\mem\register.php on
line 7
Notice: Undefined index: email_address in
c:\inetpub\wwwroot\mem\register.php on line 8
Notice: Undefined index: username in c:\inetpub\wwwroot\mem\register.php
on
line 9
Notice: Undefined index: info in c:\inetpub\wwwroot\mem\register.php on
line
10