Hi everybody,
I am making my website using php now my script is running successsfully but every page it gives a notice regarding my variable how can i remove this "
Notice: Undefined index: qid in e:\inetpub\wwwroot\ ry
ew.php on line 3
Notice: Undefined index: B1 in e:\inetpub\wwwroot\ ry
ew.php on line 4
Notice: Undefined index: S1 in e:\inetpub\wwwroot\ ry
ew.php on line 5"
what is this ?Is this error or warnning?Plz help me.my code is as follows:
<?php
include(‘conn.php’);
$qid= $_POST[‘qid’];
$submit= $_POST[‘B1’];
$text=$_POST[‘S1’];
if ($submit==“Button”)
{
$ins= “update student set ans=‘$text’ where qid=$qid”;
mysql_query($ins) or
die ("Cannot insert into database ");
header(‘location: /try/no.html’);
}
?>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<BODY>
<p align=“center”>the question was<input type=“text” name=“s2” rows=“2” value =“<? echo $_REQUEST[‘quest’]; ?>” cols=“50” ></textarea></p>
<form method=“POST” action=“<?php echo $_SERVER[‘PHP_SELF’];?>”>
<input name=“qid” type=“hidden” value=“<?php echo $_REQUEST[‘qid’]; ?>” >
<p align=“center”>What is your answer?<textarea rows=“2” name=“S1” cols=“20”></textarea></p>
<p align=“center”><input type=“submit” value=“Button” name=“B1”></p>
</form>
</BODY>
</HTML>