amir4oracle
Programmer
The following Code is giving the following Error/notice "Undefined index" in the text box f_name ... kindly help me:
-----------------------------------------------------------------------------
CODE:
1 <?
2
3 if (isset ($_POST['submit']))
4 {
5 $message = NULL;
6
7 if (strlen ($_POST['f_name']) > 0)
8 {
9 $f_name = TRUE;
10 }
11 else
12 {
13 $f_name = FALSE;
14 $message = '<p>You forgot to enter name.</p>';
15 }
16 }
17
18 ?>
19
20 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
21
22 Name: <input type="text" name="f_name" size="20" maxlength="40" value="<?php echo ($_POST ['f_name']); ?>" />
23
24 <input type="submit" name="submit" value="Submit Information"/>
25
26 </form>
-----------------------------------------------------------------------------
Error/notice:
<br /><b>Notice</b>: Undefined index: f_name in <b>c:\inetpub\ on line <b>22</b><br />
-----------------------------------------------------------------------------
CODE:
1 <?
2
3 if (isset ($_POST['submit']))
4 {
5 $message = NULL;
6
7 if (strlen ($_POST['f_name']) > 0)
8 {
9 $f_name = TRUE;
10 }
11 else
12 {
13 $f_name = FALSE;
14 $message = '<p>You forgot to enter name.</p>';
15 }
16 }
17
18 ?>
19
20 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
21
22 Name: <input type="text" name="f_name" size="20" maxlength="40" value="<?php echo ($_POST ['f_name']); ?>" />
23
24 <input type="submit" name="submit" value="Submit Information"/>
25
26 </form>
-----------------------------------------------------------------------------
Error/notice:
<br /><b>Notice</b>: Undefined index: f_name in <b>c:\inetpub\ on line <b>22</b><br />