function check_hash_plus_salt($ID, $inputPass) { /* This function validates the player_id and password data by checking against the hashed/salted value * stored in the DB for the corresponding player_id. * $ID --- player_id entered in form * $inputPass --- password entered in form */ $_hashpass = retrieve_data("Players", "hashpass_plus_salt", "WHERE player_id = " . $ID); $hashpass = $_hashpass[0]["hashpass_plus_salt"]; if (crypt($inputPass, $hashpass) == $hashpass) { return "Success!"; } else { return "PlayerID or Password Incorrect"; } }
<?php ini_set('display_errors', 1); require_once 'TwitterAPIExchange.php'; require_once 'helper.php'; /* retrieve data from twitter */ $init_time = microtime(true); // $data = retrieve_data(array('Letsintern','StarSportsIndia','Favstar500Favs','high_on_glitter','Tesco','ZeeNews','technicalhumans','finance_news__','BillGates','iamsrk','narendramodi','MTVIndia')); $data = retrieve_data('espn'); $final_time = microtime(true); echo "<br/>Time taken to retreive data from twitter : " . ($final_time - $init_time) . " seconds <br/>"; // store the data to the database $init_time = microtime(true); store_data($data, 'sports'); $final_time = microtime(true); echo "Time taken to store data to the database : " . ($final_time - $init_time) . " seconds <br/>";
<div class="clearfix visible-sm-block"></div> <div class=" col-md-4 col-sm-6"> <h3 class="header" > <a href="general.php?sec=Young"> لجنة الشباب </a></h3> <?php $data = retrieve_data("alcYoungTable", 4); list($header, $text, $imgLink, $id) = $data; news_list("Young", $id, $header, $imgLink); ?> </div> <div class=" col-md-4 col-sm-6"> <h3 class="header"><a href="general.php?sec=School">مدرسة الكوثر</a></h3> <?php $data = retrieve_data("alcSchoolTable", 4); list($header, $text, $imgLink, $id) = $data; news_list("School", $id, $header, $imgLink); ?> </div> </div> <!-- ********* footer **************** --> <?php include "htmlPieces/footer.php"; ?> </div> <script src="js/jquery-2.1.4.min.js"></script>
$death = max($y1, $y2); add_life($birth, $death); } //Query the entire population from the database and store in array $population = retrieve_data('population', '*'); /* In the following block of code we will loop through the years 1900-2000, * retrieve and count everyone for which the year in questions falls on or between * their birth year and death year. (For simplicity assume everyone is born Jan 1 and * everyone dies Dec 31) * We simply find the max count of people alive each year and store that along with * the years where that count occurred. */ $years = array(); $max = 0; for ($i = 1900; $i <= 2000; $i++) { $alive = retrieve_data('population', '*', 'WHERE birth_year <= ' . $i . ' AND death_year >= ' . $i); $count_alive = count($alive); if ($count_alive >= $max) { if ($count_alive > $max) { $years = array(); } $years[] = $i; $max = $count_alive; } } echo "<h4>The maximum number of people alive is: " . $max . ", which occurs the following year(s):</h4>"; ?> <ul> <?php foreach ($years as $year) { echo "<li>" . $year . "</li>";
function retrieve_external_userdata() { global $data_dir, $username, $password; include "../plugins/retrieveuserdata/config.php"; include "../plugins/retrieveuserdata/{$retrieve_data_from}"; $cleartext_password = OneTimePadDecrypt($password, $onetimepad); $userdata = retrieve_data($username, $cleartext_password); if (!$userdata["error"]) { set_userdata($userdata["common_name"], $userdata["mail_address"]); set_userdata_backup($userdata["common_name"], $userdata["mail_address"]); setPref($data_dir, $username, "got_external_userdata", 1); } }
<img src="images/logo.png"> </div> <div id="head-text"> <p id="header"><small>مؤسسة </small> الكوثر <small>الثقافية</small></p><br> <p id="subHeader">Stichting Alcauther</p> </div> <div id="date" > <!-- The date --> <?php date_default_timezone_set('UTC'); $time = time(); // TO control the data cahnge this variable include "../../includes/connect2db.php"; // configration - connection and selection \\ include "../../includes/functions.php"; $date = retrieve_data("alcDateTable", 1); $t = (int) htmlentities(trim($date[0][0])); // if($numOfDays < 7){ $time = $time + 60 * 60 * 24 * $date[0][0]; // } require 'I18N/Arabic.php'; $obj = new I18N_Arabic('Date'); $fix = $obj->dateCorrection($time); echo '<span style="color:#fff; padding: 0 0 4px 4px; " class="hidden-sm hidden-xs">'; echo $obj->date('dS F Y ', $time) . ' - '; $fix = $obj->dateCorrection($time); $obj->setMode(3); echo $obj->date('l dS F Y ', $time, $fix) . '</span>'; ?> </div> </header>
echo '<a href="admins-area/delete.php?del=Yes&id=' . $id . '&part=' . $part . '">'; echo 'نعم </a> | <a href="?del=No&id=' . $id . '&part=' . $part . '"> لا </a></p>'; } ?> <?php include "htmlPieces/header.php"; ?> <!--************* header ***************--> <?php navbar(0); ?> <!--************* navbar ***************--> <aside class="col-sm-4 hidden-xs"> <!-- get and dispaly data --> <?php $data = retrieve_data("alcHeadNewsTable", 5); list($as_header, $text, $imgLink, $id) = $data; news_list("HeadNews", $id, $as_header, $imgLink); ?> <!-- Facebook--> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <div class="fb-page" data-href="https://www.facebook.com/%D9%85%D8%A4%D8%B3%D8%B3%D8%A9-%D8%A7%D9%84%D9%83%D9%88%D8%AB%D8%B1-%D8%A7%D9%84%D8%AB%D9%82%D8%A7%D9%81%D9%8A%D8%A9-125618677510352/" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-show-posts="false"></div> <!-- Facebook-->
if ($pid > 0 && $pid < 4) { $message = check_hash_plus_salt($pid, $pwd); } else { $message = "Invalid Player ID"; } } else { $message = "Please fill all fields"; } if ($message == "Success!") { /* After successfully validating the more static data elements, * we validate the rest... */ if (isset($_POST['coins_bet']) && isset($_POST['coins_won'])) { $b = $_POST['coins_bet']; $w = $_POST['coins_won']; $info = retrieve_data("Players", "*", "WHERE player_id = " . $pid); $player_id = $info[0]['player_id']; $name = $info[0]['name']; $total_credits = $info[0]['credits']; $total_spins = $info[0]['lifetime_spins']; $total_won = $info[0]['lifetime_won']; $total_bet = $info[0]['lifetime_bet']; if ($b > 0 && $b <= $total_credits) { if ($w == $coins_won) { /* Last check is successful (the value ready to be saved to the DB is * the correct number of coins actually won) * * Now we are ready to update values for the DB record and write to the table */ $message = "You won " . $w . " coins"; $total_spins += 1;