( ! ) Notice: Undefined index: emailaddress_input in C:\wamp\www\test\feedbackadd.php on line 17
Call Stack
# Time Memory Function Location
1 0.0012 256400 {main}( ) ..\feedbackadd.php:0
( ! ) Notice: Undefined index: telephonenumber_input in C:\wamp\www\test\feedbackadd.php on line 18
Call Stack
# Time Memory Function Location
1 0.0012 256400 {main}( ) ..\feedbackadd.php:0
( ! ) Notice: Undefined index: comments_input in C:\wamp\www\test\feedbackadd.php on line 19
Call Stack
# Time Memory Function Location
1 0.0012 256400 {main}( ) ..\feedbackadd.php:0
This is the PhP code
<?php
//the example of inserting data with variable from HTML form
//input.php
$connection = mysql_connect("localhost", "root", ""); //database connection
if (!$connection) {
$db_found = mysql_select_db("fillform");
die('Could not connect: ' . mysql_error());
}
$db_found = mysql_select_db("fillform");
$firstname = trim($_POST['firstname_input']);
$lastname = trim($_POST['lastname_input']);
$emailaddress = trim($_POST['emailaddress_input']);
$telephonenumber = trim($_POST['telephonenumber_input']);
$comments = trim($_POST['comments_input']);
//inserting data order
$sql_command = "INSERT INTO fillform (firstname, lastname, emailaddress, telephonenumber, comments) VALUES('$firstname','$lastname','$emailaddress','$telephonenumber','$comments')";
//declare in the order variable
$result = mysql_query($sql_command); //order executes
if ($result) {
echo "<br>Input data is \"succeed\"";
} else {
echo("<br>Input data is fail");
}
mysql_close($connection);
?>
This is the HTML code
<!DOCTYPE HTML>
<html>
<head>
<title>Feedback</title>
</head>
<body>
<table border="1">
<tr>
<td>
<table>
<form method="post" action="feedbackadd.php">
<tr>
<td>First Name</td>
<td><input type="text" First Name="firstname_input" size="40">
</td>
</tr>
<tr>
<td>Last Name</td>
<td><input type="text" Last Name="lastname_input" size="40">
</td>
</tr>
<tr>
<td>Email Address</td>
<td><input type="text" Email Address="emailaddress_input" size="40">
</td>
</tr>
<tr>
<td>Telephone Number</td>
<td><input type="text" Telephone Number="telephonenumber_input" size="40">
</td>
</tr>
<tr>
<td>Comments</td>
<td><input type="text" Comments="comments_input" size="40">
</td>
</tr>
<tr>
<td></td>
<td align="right"><input type="submit"
name="submit" value="Sent"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Appreciated your help.



