It gives following error - Array ( [name] => asha => ffffff [address] => ttttt [Submit] => Submit ) Notice: Use of undefined constant name1 - assumed 'name1' in C:\wamp\www\dreamweaver site\add.php on line 10 Notice: Undefined index: name1 in C:\wamp\www\dreamweaver site\add.php on line 10 Notice: Undefined index: email1 in C:\wamp\www\dreamweaver site\add.php on line 11 Notice: Undefined index: address1 in C:\wamp\www\dreamweaver site\add.php on line 12 my program code is - [B]contact.php[/B] <body> <form name='form1' method="post" action="add.php"> <table width="942" height="335" border="1"> <tr> <td><label></label> Name</td> <td><label> <input type="text" name="name" /> </label></td> <td> </td> </tr> <tr> <td>Email</td> <td><label> <input type="text" name="email" /> </label></td> <td> </td> </tr> <tr> <td>Address</td> <td><label> <textarea name="address"></textarea> </label></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><label> <input type="submit" name="Submit" value="Submit" /> <br /> <br /> </label></td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> <form> </body> [B]add.php[/B] <body> <?php print_r($_POST); $n=$_REQUEST[name1]; $e=$_REQUEST['email1']; $a=$_POST['address1']; echo $n; echo $e; echo $a; ?> </body> please help me to solve this problem.
arrays start from 0 not one i guess Also in your forms why you use name1, email1, address1 when your form doesnt have 1 as the name
sorry. It is duplicate program. in my orignal contact.php program I have given control name as name1, email1 and address1. Thanks.
In add.php change the name1 line to this: $n=$_REQUEST['name1']; PHP: You get the undefined index, because you are trying to call up an element with as a constant (i.e. define('constant_name', 'constant_value')). Basically, if you want to access an element - put it in quotes.