function &app() { // Make sure there is a valid session validate_session(); $HTML = array(); $HTML['dob'] = get_SESSION('dob'); $HTML['datepicker'] = date("m-d-Y"); return $HTML; }
function getContries() { $arr = connect('select * from countries'); $strContries = "<option value=''>Please Select</option>\n"; for ($i = 0; $i < count($arr); $i++) { $row = $arr[$i]; if ($row['active'] != "NO") { if (get_SESSION('country') == $row['countryID']) { $strContries .= "<option value='" . $row['countryID'] . "' selected='selected'>" . $row['country'] . "</option>\n"; } else { $strContries .= "<option value='" . $row['countryID'] . "'>" . $row['country'] . "</option>\n"; } } } return $strContries; }
function updateUser(&$info, $use_enc_pass) { if (empty($GLOBALS['DB'])) { die('Database Link is not set'); } // Build the query string $query = sprintf('UPDATE users SET email=\'%s\', city=\'%s\', countryID=\'%s\', password=\'%s\' WHERE userID=\'%s\'', mysql_real_escape_string($info['email']), mysql_real_escape_string($info['city']), mysql_real_escape_string($info['countryID']), mysql_real_escape_string($use_enc_pass ? $info['password_encrypted'] : md5($info['password'])), mysql_real_escape_string(get_SESSION('userID'))); // Exceute the query $result = mysql_query($query); // Check that it worked if (!$result) { die('Could not update user' . $query . mysql_error()); } return; }
<div id="chart" class=" <?php if (empty($_SESSION)) { echo "hide"; } ?> "> <div id="topbanner"> <form action="php/logout.php" method="post"> <input type="submit" value="Logout" /> </form> </div> <div id="sidebar"> <p id="dob">Date of Birth: <?php echo get_SESSION('dob'); ?> </p> <label for="dob">Select a Date:</label> <input id="datepicker2" type="text" value="" /> </div> <div id="graph"> <div class="arrow"><img src="img/leftarrow.png"></div> <div> <img width='600' id="googleimage" height='400' src='./img/chart.png'> <div class="arrow"><img src="img/rightarrow.png"></div> </div> </div> </body> </html>