Hi Horizon88, I have spent many hours trying to get this to work but failed. This is the code I have used taken from your example which is the gender (and simpliest) selection;
<SELECT NAME="gender">
<?php
if($SESSION['gender'] == 'selected'){
echo '<OPTION VALUE="selected">Selected</OPTION>';
}
else {
echo $SESSION['gender'];
}
?>
<OPTION><OPTION>Female<OPTION>Male</SELECT></TD>
And I am also trying to do a similar thing with the birthdate and I suspect the month (because it has a double VALUE) will cause another problem and here is the code I am using for that;
<SELECT NAME="month">
<?php
if($SESSION['month'] == 'selected'){
echo '<OPTION VALUE="selected">Selected</OPTION>';
}
else {
echo $SESSION['month'];
}
?>
<OPTION><OPTION VALUE="01">January<OPTION VALUE="02">February<OPTION VALUE="03">March<OPTION VALUE="04">April<OPTION VALUE="05">May<OPTION VALUE="06">June<OPTION VALUE="07">July<OPTION VALUE="08">August<OPTION VALUE="09">September<OPTION VALUE="10">October<OPTION VALUE="11">November<OPTION VALUE="12">December</SELECT>
I have tried multiple variations of the above, such as putting it in various places and changing various words but nothing works.
At the start of the script I have the following;
<?php
session_start();
include("Database.php");
if(isset($POST['subjoin'])){
$SESSION['user'] = $POST['user'];
$SESSION['pass'] = ($POST['pass']);
$SESSION['gender'] = $POST['gender'];
$SESSION['day'] = $POST['day'];
$SESSION['month'] = $POST['month'];
$SESSION['year'] = $_POST['year'];
}
There are no problems with the username and password being saved. I do tend to believe it is only something simple that is not quite right.
Regards, David.