當前位置: 首頁>>代碼示例>>PHP>>正文


PHP H::input方法代碼示例

本文整理匯總了PHP中H::input方法的典型用法代碼示例。如果您正苦於以下問題:PHP H::input方法的具體用法?PHP H::input怎麽用?PHP H::input使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在H的用法示例。


在下文中一共展示了H::input方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: elseif

     } else {
         \Lobby::redirect("/#");
     }
 } elseif ($_GET['step'] == 2 && H::csrf()) {
     /**
      * We call it again, so that the user had already went through the First Step
      */
     if (\Lobby\Install::step1() === false) {
         // The stuff mentioned in step 1 hasn't been done
     } elseif (isset($_POST['submit'])) {
         $dbhost = \H::input('dbhost', "POST");
         $dbport = \H::input('dbport', "POST");
         $dbname = \H::input('dbname', "POST");
         $username = \H::input('dbusername', "POST");
         $password = \H::input('dbpassword', "POST");
         $prefix = \H::input('prefix', "POST");
         /**
          * We give the database config to the Install Class
          */
         \Lobby\Install::dbConfig(array("host" => $dbhost, "port" => $dbport, "dbname" => $dbname, "username" => $username, "password" => $password, "prefix" => $prefix));
         /**
          * First, check if prefix is valid
          * Check if connection to database can be established using the credentials given by the user
          */
         if ($prefix == "" || preg_match("/[^0-9,a-z,A-Z,\$,_]+/i", $prefix) != 0 || strlen($prefix) > 50) {
             ser("Error", "A Prefix should only contain basic Latin letters, digits 0-9, dollar, underscore and shouldn't exceed 50 characters. <a href='install.php?step=2'>Try Again</a>");
         } elseif (\Lobby\Install::checkDatabaseConnection() !== false) {
             /**
              * Make the Config File
              */
             \Lobby\Install::makeConfigFile();
開發者ID:saviobosco,項目名稱:lobby,代碼行數:31,代碼來源:install.php

示例2: ser

    $App = new \Lobby\Apps($_GET['id']);
    if (!$App->exists) {
        ser("Error", "App is not installed");
    }
    $App->enableApp();
    sss("Enabled", "The App <b>{$_GET['id']}</b> is enabled. The author says thanks.<a href='" . $App->info['URL'] . "' class='button green'>Open App</a>");
}
if (H::input("action") == "remove" && H::csrf()) {
    $App = new \Lobby\Apps($_GET['id']);
    if (!$App->exists) {
        ser("Error", "App is not installed");
    }
    $App->removeApp();
    sss("Removed", "The App <b>{$_GET['id']}</b> was successfully removed.");
}
$id = H::input("id");
if ($id != null && H::input("action") == null && H::csrf()) {
    ?>
          <h1>Install App</h1>
          <iframe src="<?php 
    echo L_URL . "/admin/download.php?type=app&id={$id}" . H::csrf("g");
    ?>
" style="border: 0;width: 100%;height: 200px;"></iframe>
        <?php 
}
?>
      </div>
    <div>
  </body>
</html>
開發者ID:saviobosco,項目名稱:lobby,代碼行數:30,代碼來源:install-app.php

示例3: header

<?php

require_once __DIR__ . "/../load.php";
require_once L_DIR . "/includes/src/Update.php";
header("Content-type: text/html");
header('Cache-Control: no-cache');
$id = H::input("id");
$type = H::input("type");
// Turn off output buffering
ini_set('output_buffering', 'off');
// Turn off PHP output compression
ini_set('zlib.output_compression', false);
//Flush (send) the output buffer and turn off output buffering
//ob_end_flush();
while (@ob_end_flush()) {
}
// Implicitly flush the buffer(s)
ini_set('implicit_flush', true);
ob_implicit_flush(true);
if ($id == null || H::csrf() == false) {
    exit;
}
if ($type == "app") {
    $app = \Lobby\Server::Store(array("get" => "app", "id" => $id));
    if ($app == "false") {
        echo "Error - App '<b>{$id}</b>' does not exist in Lobby.";
        exit;
    }
    $name = $app['name'];
} else {
    $name = "Lobby {$id}";
開發者ID:saviobosco,項目名稱:lobby,代碼行數:31,代碼來源:download.php

示例4: list

<?php

$q = H::input("question_id");
$answer = H::input("answer");
if ($q != null && $answer != null) {
    $questions = json_decode($this->get("/src/Data/questions.json"), true);
    list($q_parent, $q_child) = explode("-", $q);
    if (isset($questions[$q_parent][$q_child])) {
        $item = $questions[$q_parent][$q_child];
        $hashed_answer = hash("md5", $answer);
        if ($hashed_answer == strtolower($item['answer'])) {
            $_SESSION['app-millionaire-level'] = $q_parent;
            echo "correct";
        } else {
            foreach ($item['options'] as $option) {
                if (hash("md5", $option) == $item['answer']) {
                    $right_answer = $option;
                }
            }
            echo json_encode(array("money" => $this->money(), "correct" => $right_answer));
        }
    }
}
開發者ID:saviobosco,項目名稱:lobby,代碼行數:23,代碼來源:answer.php

示例5: sss

        echo '<td><span style="vertical-align:middle;display:inline-block;margin-left:5px;">' . $AppInfo['name'] . '</span></td>';
        echo '<td>' . $AppInfo['version'] . '</td>';
        echo '<td>' . $latest_version . '</td>';
        echo '</tr>';
    }
    ?>
            </tbody></table>
            <input type="hidden" name="action" value="updateApps" />
            <button class="red" style='padding: 10px 15px;' clear>Update Selected Apps</button>
          </form>
        <?php 
}
if (getOption("lobby_version") == getOption("lobby_latest_version") && !\H::input("action", "POST") == "updateApps") {
    echo "<h2>Lobby</h2>";
    sss("Latest Version", "You are using the latest version of Lobby. There are no new releases yet.");
} elseif (!isset($_GET['step']) && !\H::input("action", "POST") == "updateApps") {
    ?>
          <h2>Lobby</h2>
          <p>
            Welcome To The Lobby Update Page. A latest version is available for you to upgrade.
          </p>
          <blockquote>
            Latest Version is <?php 
    echo getOption("lobby_latest_version");
    ?>
            released on <?php 
    echo date("jS F Y", strtotime(getOption("lobby_latest_version_release")));
    ?>
          </blockquote>
          <p style="margin-bottom: 10px;">
            Lobby will automatically download the latest version and install. In case something happens, Lobby will not be accessible anymore. So backup your database and Lobby installation before you do anything.
開發者ID:saviobosco,項目名稱:lobby,代碼行數:31,代碼來源:update.php

示例6: ucfirst

<?php

$network = \H::input("network");
$this->addScript("connect.js");
if (isset($this->available_networks[$network])) {
    $Network = ucfirst($network);
    ?>
  <div class='contents'>
    <h1>Connect <?php 
    echo $Network;
    ?>
</h1>
    <p>Please enter your <?php 
    echo ucfirst($network);
    ?>
 account's username and password.</p>
    <form id='login_form' data-network="<?php 
    echo $network;
    ?>
">
      <input type='text' name='username' placeholder='Email/Phone Number' />
      <input type='password' name='password' placeholder='Password' />
      <input type='submit' value='Log In To <?php 
    echo $Network;
    ?>
' />
    </form>
    <div id='login_status' clear></div>
  </div>
  <style>
    .contents input{
開發者ID:saviobosco,項目名稱:lobby,代碼行數:31,代碼來源:connect.php

示例7: list

<?php

$q = H::input("question_id");
if ($q != null) {
    $questions = json_decode($this->get("/src/Data/questions.json"), true);
    list($q_parent, $q_child) = explode("-", $q);
    if (isset($questions[$q_parent][$q_child])) {
        $item = $questions[$q_parent][$q_child];
        $wrong = array();
        shuffle($item['options']);
        foreach ($item['options'] as $option) {
            if (hash("md5", $option) != $item['answer'] && count($wrong) != 2) {
                $wrong[] = $option;
            }
        }
        echo json_encode($wrong);
    }
}
開發者ID:saviobosco,項目名稱:lobby,代碼行數:18,代碼來源:fifty-fifty.php


注:本文中的H::input方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。