I tried to insert data using the following code, but I really I don't know how can I get result and what is the problem in my code, I tried to build firstly my form then I write the insert query and send it to a new form , any HELP please : Also I Have now the following error:
Notice: Undefined index: Services in C:\xampp\htdocs\ers\test.php on line 11
Notice: Undefined index: title in C:\xampp\htdocs\ers\test.php on line 12
Notice: Undefined index: RootCause in C:\xampp\htdocs\ers\test.php on line 13
Notice: Undefined index: RiskRating in C:\xampp\htdocs\ers\test.php on line 14
Notice: Undefined index: impact in C:\xampp\htdocs\ers\test.php on line 15
Notice: Undefined index: Efforts in C:\xampp\htdocs\ers\test.php on line 16
Notice: Undefined index: likelihood in C:\xampp\htdocs\ers\test.php on line 17
Notice: Undefined index: Finding in C:\xampp\htdocs\ers\test.php on line 18
Notice: Undefined index: Implication in C:\xampp\htdocs\ers\test.php on line 19
Notice: Undefined index: Recommendation in C:\xampp\htdocs\ers\test.php on line 20 Error: Cannot add or update a child row: a foreign key constraint fails (ers_1.findings, CONSTRAINT findings_ibfk_15 FOREIGN KEY (ServiceType_ID) REFERENCES servicetype_lookup (ServiceType_ID) ON UPDATE NO ACTION)
_____________________________________________________________________________________________________
This is my code :
<html>
<body>
<?php
$con = mysql_connect("localhost","root","123");
error_reporting(0);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
?>
<form method="post" action="test.php">
<fieldset>
<legend>Insert New Data </legend>
<p> Service Name :
<select name="Services">
<option value="select"> -Select- </option>
<option value="architecture review">Architecture Review</option>
<option value="internal penetration testing">Internal Penetration Testing</option>
<option value="network component review">Network Component Review</option>
<option value="database review">Database Review</option>
<option value="wireless network">Wireless Network</option>
<option value="operating system review">Operating System Review</option>
<option value="web application">Web Application</option>
<option value="external penetration testing">External Penetration Testing</option>
</select>
</p>
<form method="post" action="test.php">
Ref : <input type="text" name="ref" /><br />
Title : <input type="text" name="title" /><br />
Risk Rating :
<select name="RiskRating">
<option value="select"> -Select- </option>
<option value="High">High</option>
<option value="Medium">Medium</option>
<option value="Low">Low</option>
</select><br />
Root Cause :
<select name="RootCause">
<option value="select"> -Select- </option>
<option value="access control">Access Control</option>
<option value="configuration management">Configuration Management</option>
<option value="patch management">Patch Management</option>
<option value="patch management">Certificate Management</option>
<option value="patch management">Password Management</option>
<option value="patch management">Audit Trail and Security Logs Management</option>
<option value="service deployment">Network Management</option>
</select><br />
Impact :
<select name="impact">
<option value="select"> -Select- </option>
<option value="high"> Major </option>
<option value="moderate"> Moderate </option>
<option value="low"> Minor </option>
</select><br />
Likelihood :
<select name="likelihood">
<option value="select"> -Select- </option>
<option value="possible"> Likely </option>
<option value="impossible">Possible</option>
<option value="definite"> Moderate </option>
<option value="definite"> Rare </option>
</select><br/>
Efforts :
<select name="Efforts">
<option value="select"> -Select- </option>
<option value="possible"> Significant </option>
<option value="impossible">Moderate </option>
<option value="definite"> Intermediate </option>
<option value="definite"> Simple </option>
</select><br/>
Finding : <br/>
<TEXTAREA NAME="Finding" COLS=100 ROWS=10>