Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php session_start(); include'core/connect.php'; include'inc/top.php'; ?>
- <div class="content">
- <div class="medlemmar">
- <div class="medlem_top">
- <div class="sok"><a href="#">SÖK</a></div>
- <div class="header"><h2>Nya Medlemmar</h2></div>
- </div>
- <?php
- $query = mysql_query("SELECT `id`, `profilimg`, `username`, `age`, `gender` FROM `members`");
- while($row = mysql_fetch_array($query)){
- //date in mm/dd/yyyy format; or it can be in other formats as well
- $birthDate = $row['age'];
- //explode the date to get month, day and year
- $birthDate = explode("-", $birthDate);
- //get age from date or birthdate
- $age = (date("md", date("U", mktime(0, 0, 0, $birthDate[1], $birthDate[2], $birthDate[0]))) > date("md")
- ? ((date("Y") - $birthDate[0]) - 0)
- : (date("Y") - $birthDate[0]));
- echo '<div class="medlem_box">
- <div class="img"><img src="'.$row['profileimg'].'" alt="'.$row['username'].', '.date('Y-m-d H:i:s').'"></div>
- <div class="user_info">
- <div class="user_name">'.$row['username'].'</div>
- <div class="user_mini_info">'.$row['gender'].','.$age.'år,'.$row['city'].'</div>
- </div>
- <div class="user_link"><a href="profil.php?id='.$row['id'].'">Kolla in mig</a></div>
- </div>';
- }
- ?>
- </div>
- </div>
- <?php include'inc/bot.php';?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement