I'm storing session data in $relnum variable, as shown below:
if (!isset($_SESSION)) {
session_start();
$_SESSION['releasen'] =$_POST['release_no'];
$relnum= $_SESSION['releasen'];
}
And displaying it in form text field, as shown below;
<input name="relnu" id="relnu" type="text" value="<?php if ($rel==''){ echo $relnum;} else echo $rel; ?>" readonly="true"/>
I am submitting above Form data in mysql, as shown below;
if (isset($_POST['submitM'])) {
$faultd=$_POST['faultdistribution'];
$faultdes=$_POST['faultdescription'];
$faultsev=$_POST['faultseverity'];
$faultt=$_POST['faulttype'];
$faultn=$_POST['faultcmnt'];
$rel=$_POST['relnu'];
$query = mysql_query("INSERT INTO `fault` (`fault-cmnt`,`fault-type`, `release_no`, `fault-discription`, `fault-severity`, `fault-distribution`) VALUES ('$faultn','$faultt', '$rel', '$faultd', '$faultsev', '$faultdes')")
or die(mysql_error());
echo "Data Added sucessfully";
}
The data is successfully submitted, but after that $relnum variable displays nothing. I am unable to comprehend what is the reason, as i am storing the data in session.
P.S: I am not using unset.
Please help, what i am missing?