0

Hi i have a date of birth for members in registration form but in the couples profile im adding a date of birth for both members in the couples group as in the pics included

heres the coding for it from the profile page can anyone help be much appreciated ty jan x

$user_birthdate = $fetch_user['user_birthdate'];
$puser_birthdate = $fetch_info['puser_birthdate'];



<tr>
    <td><?php echo Age($user_birthdate);?> year old</td>
    <td><?php echo Age($puser_birthdate);?> year old<td>
  </tr>

heres coding from registration3

puser_birthdate = '".$_POST['puser_birthdate']."' ,
    user_birthdate  = '".$_POST['user_birthdate']."' ,





<tr>
    <td><select name="days" id="days" class="validate[required] dobselect" >
                <option value="">Days</option>
                <?php $day=1; while($day!=32){ ?>
                <option value="<?php echo $day;?>" <?php if($_POST['days']==$day) { echo "selected"; } ?>><?php echo $day;?></option>
                <?php $day++; } ?>
              </select> <select name="months" id="months" class="validate[required] dobselect" >
                <option value="">Months</option>
                <?php $month=1; while($month!=13){ ?>
                <option value="<?php echo $month;?>" <?php if($_POST['months']==$month) { echo "selected"; } ?> ><?php echo $month;?></option>
                <?php $month++; } ?>
              </select> <select name="years" id="years" class="validate[required] dobselect" >
                <option value="">Years</option>
                <?php $year=1915; while($year!=1998){ ?>
                <option value="<?php echo $year;?>" <?php if($_POST['years']==$year) { echo "selected"; } ?> ><?php echo $year;?></option>
                <?php $year++; } ?>
              </select></td>
    <td><select name="pdays" id="pdays" class="validate[required] dobselect" >
                <option value="">Days</option>
                <?php $day=1; while($day!=32){ ?>
                <option value="<?php echo $day;?>" <?php if($_POST['pdays']==$day) { echo "selected"; } ?>><?php echo $day;?></option>
                <?php $day++; } ?>
              </select> <select name="pmonths" id="pmonths" class="validate[required] dobselect" >
                <option value="">Months</option>
                <?php $month=1; while($month!=13){ ?>
                <option value="<?php echo $month;?>" <?php if($_POST['pmonths']==$month) { echo "selected"; } ?> ><?php echo $month;?></option>
                <?php $month++; } ?>
              </select> <select name="pyears" id="pyears" class="validate[required] dobselect" >
                <option value="">Years</option>
                <?php $year=1915; while($year!=1998){ ?>
                <option value="<?php echo $year;?>" <?php if($_POST['pyears']==$year) { echo "selected"; } ?> ><?php echo $year;?></option>
                <?php $year++; } ?>
              </select></td>
</tr>

and heres database code for those 2 bits

`puser_birthdate` varchar(50) NOT NULL,
  `user_birthdate` varchar(50) NOT NULL,
Attachments date_of_birth_shot.png 1.51 KB show_age_shot.png 1.05 KB
3
Contributors
5
Replies
28
Views
2 Years
Discussion Span
Last Post by janicemurby
0

What a palaver. Why aren't you using a datepicker? That is just ridiculously complicated without having to be. You could replace the above with just:

<input name="user" type="date" />
<input name="puser" type="date" />

Edited by diafol

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.