Possible Duplicate:
PHP: “Notice: Undefined variable” and “Notice: Undefined index”
enter code here
this is php code
$choice_spc_port = $_POST["txtSpace"]; (THIS LINE GIVES UNDEFINED INDEX NOTICE)
$choice_loc = $_POST["txtLocation"]; (THIS LINE GIVES UNDEFINED INDEX NOTICE)
And this is HTML Form
<form id="animalform" name="animalform" method="post" action="animalform.php">
<div class="wrapper"> <strong><span>*</span> Text Space portion:</strong>
<div class="formText">
<input type="radio" name="txtSpace" value="HR"/>Text space for Horse.<br />
<input type="radio" name="txtSpace" value="ZB"/>Text Space For Zebra<br />
</div>
</div>
<div class="wrapper"> <strong><span>*</span> Animal Location:</strong>
<div class="formText">
<input type="radio" name="txtLocation" value="txtSetXY"/> Specify Animal Location<br />
<div style="padding-left:20px;">
X: <input type="text" id="locField" name="txtXLocation"> <span>Taking (x=1,y=1) top left box. Increment +1 in value of X moving right</span><br />
Y: <input type="text" id="locField" name="txtYLocation"> <span>Taking (x=1,y=1) top left box. Increment +1 in value of Y moving downwards</span><br />
</div>
<input type="radio" name="txtLocation" value="Default"/>Default
</div>
</div>
</div>
Query to insert in database
$insert = "INSERT INTO dbForm (db_space_portion, db_animal_location) VALUES ('{$choice_spc_port}', '{$choice_loc}')";
I tried the same in firefox and those two lines give notice as mentioned in bracket. Also on internet many people are looking for solution. So I think this question will help many out there.