Possible Duplicate:
PHP: “Notice: Undefined variable” and “Notice: Undefined index”
In this once the submit button is clicked it retrieve the data from database. But once i enter this page Undefined index: submit is shown before i click the submit button.
<div id="title">
<form method="get" action="<?php echo $_SERVER['PHP_SELF']?>">
<h3>Select your product and click submit</h3><br />
<select name="prod">
<option value="default">Select your product</option>
<option value="os">Operating Systems</option>
<option value="mobile">Smart Mobiles</option>
<option value="mobile">Computers</option>
<option value="shirt">Shirts</option>
</select><br /><br />
<input type="submit" value="Submit" name="submit"/>
</form>
The php code is:
<?php
$submitcheck=$_GET['submit'];
echo $submitcheck;
if (!isset($submitcheck)) {
echo 'Pls select and submit';
} else {
....
}
?>