runnerjp
05-19-2008, 02:41 PM
ok i have my table set out like so
Code:
<label for="birthmonth">Birth Month:</label>
<select class="input" name="birthmonth" id="birthmonth">
<option value="January" <?php if($birthmonth == 'January') echo 'selected'; ?>>January</option>
<option value="Febuary" <?php if($birthmonth == 'Febuary') echo 'selected'; ?>>Febuary</option>
<option value="March" <?php if($birthmonth == 'March') echo 'selected'; ?>>March</option>
<option value="April" <?php if($birthmonth == 'April') echo 'selected'; ?>>April</option>
<option value="May" <?php if($birthmonth == 'May') echo 'selected'; ?>>May</option>
<option value="June" <?php if($birthmonth == 'June') echo 'selected'; ?>>June</option>
<option value="July" <?php if($birthmonth == 'July') echo 'selected'; ?>>July</option>
<option value="August" <?php if($birthmonth == 'August') echo 'selected'; ?>>August</option>
<option value="September" <?php if($birthmonth == 'September') echo 'selected'; ?>>September</option>
<option value="October" <?php if($birthmonth == 'October') echo 'selected'; ?>>October</option>
<option value="November" <?php if($birthmonth == 'November') echo 'selected'; ?>>November</option>
<option value="December" <?php if($birthmonth == 'December') echo 'selected'; ?>>December</option>
what should happen is the previous selected dob is echod but its not... culd it be that i join them all together like so
$birthyear = mysql_real_escape_string( $_POST['birthyear']);
$birthmonth = mysql_real_escape_string( $_POST['birthmonth']);
$birthday = mysql_real_escape_string( $_POST['birthday']);
$dob = $birthday.'-'.$birthmonth.'-'.$birthyear;
??
Code:
<label for="birthmonth">Birth Month:</label>
<select class="input" name="birthmonth" id="birthmonth">
<option value="January" <?php if($birthmonth == 'January') echo 'selected'; ?>>January</option>
<option value="Febuary" <?php if($birthmonth == 'Febuary') echo 'selected'; ?>>Febuary</option>
<option value="March" <?php if($birthmonth == 'March') echo 'selected'; ?>>March</option>
<option value="April" <?php if($birthmonth == 'April') echo 'selected'; ?>>April</option>
<option value="May" <?php if($birthmonth == 'May') echo 'selected'; ?>>May</option>
<option value="June" <?php if($birthmonth == 'June') echo 'selected'; ?>>June</option>
<option value="July" <?php if($birthmonth == 'July') echo 'selected'; ?>>July</option>
<option value="August" <?php if($birthmonth == 'August') echo 'selected'; ?>>August</option>
<option value="September" <?php if($birthmonth == 'September') echo 'selected'; ?>>September</option>
<option value="October" <?php if($birthmonth == 'October') echo 'selected'; ?>>October</option>
<option value="November" <?php if($birthmonth == 'November') echo 'selected'; ?>>November</option>
<option value="December" <?php if($birthmonth == 'December') echo 'selected'; ?>>December</option>
what should happen is the previous selected dob is echod but its not... culd it be that i join them all together like so
$birthyear = mysql_real_escape_string( $_POST['birthyear']);
$birthmonth = mysql_real_escape_string( $_POST['birthmonth']);
$birthday = mysql_real_escape_string( $_POST['birthday']);
$dob = $birthday.'-'.$birthmonth.'-'.$birthyear;
??