here is the code:
Code: Select all
<?
require_once 'library/config.php';
if(isset($_SESSION['login_user']) && $_SESSION['login_user'] == 'ok'){
$user = $_SESSION['login_name'];
$sql = "SELECT * FROM tbl_customer WHERE Username = '$user'";
$result = dbQuery($sql);
$row = dbFetchAssoc($result);
extract($row);
$now = mktime();
$timeofbirth = mktime(0,0,0,$BDay);
$Age = $now - $timeofbirth;
$Age2 = $Age /(60*60*24*365.25);
?>
<table cellpadding="0" cellspacing="0" border="1" width="300" style="font-family:sans-serif" align="center">
<tr>
<td>
<?php require_once 'include/top.php';?>
</td>
</tr>
<tr>
<td>
<?php require_once 'include/mainmenu.php';?>
</td>
</tr>
</table>
<form action="modifyprofile.php" method="post" name="modifyprofile">
<table width="48%" cellpadding="5" cellspacing="0" border="1" style="font-family:sans-serif" align="center">
<tr>
<td align="center" colspan="2">MY ACCOUNT PROFILE</td>
</tr>
<tr>
<td align="center">First Name</td>
<td class="accountmenu"><input type="text" name="fname" value="<?php echo $FirstName;?>"></td>
</tr>
<tr>
<td align="center">Last Name</td>
<td class="accountmenu"><input type="text" name="lname" value="<?php echo $LastName;?>"></td>
</tr>
<tr>
<td align="center">Birthday</td>
<td class="accountmenu"><input type="text" name="bday" value="<?php echo $BDay;?>"></td>
</tr>
<tr>
<td align="center">Age</td>
<td class="accountmenu"><input type="text" name="age" value="<?php echo $Age2;?>"></td>
</tr>
<tr>
<td align="center">Contact No.</td>
<td class="accountmenu"><input type="text" name="contact" value="<?php echo $Contactno;?>"></td>
</tr>
<tr>
<td align="center">Email</td>
<td class="accountmenu"><input type="text" name="email" value="<?php echo $Email;?>"></td>
</tr>
<tr>
<td align="center">Username</td>
<td class="accountmenu"><input type="text" name="user" value="<?php echo $Username;?>"></td>
</tr>
<tr>
<td class="accountmenu" colspan="2" align="center"><input type="submit" id="modifyprofile" value="modify">
<input type="button" id="modifyprofile" value="back" onClick="window.location.href='index.php';"></td>
</tr>
</table>
</form>
<?php
}
?>
</body>Notice: A non well formed numeric value encountered in C:\Program Files\xampp\xampp\htdocs\ieccTESTproj\viewprofile.php on line 17
i'm still testing on localhost..
and the age it displayed is this:
37.6798795853
the birthdate is:
1987-12-08
someone please help!