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


PHP functions::mysql_query方法代碼示例

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


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

示例1: dirname

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <?php 
$path = dirname(__FILE__);
include $path . '/functions.php';
functions::start();
?>
    </head>
    <body>
        <?php 
$admresult = functions::mysql_query("SELECT admin FROM " . TABLE_PREFIX . "_setting", "admin", false);
if (!functions::is_logined($admresult) == true) {
    echo '<center>此頁麵為管理界麵,非管理人員請離開!</center>';
} else {
    functions::admin();
}
?>
    </body>
</html>
開發者ID:Kuludu,項目名稱:HR-management,代碼行數:21,代碼來源:admin.php

示例2: dirname

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <?php 
$path = dirname(__FILE__);
include $path . '/functions.php';
functions::start();
?>
    </head>
    <body>
        <?php 
if (!empty($_GET["name"])) {
    $name = htmlspecialchars($_GET["name"]);
    if (functions::is_logined($name) == true) {
        functions::print_form("member.php?name=" . $name, "change_pwd", '<center>更改密碼<input type="text" name="pwd" /></center>');
        if (!empty($_POST["pwd"])) {
            $pwd = htmlspecialchars($_POST["pwd"]);
            functions::mysql_query('UPDATE ' . TABLE_PREFIX . '_members SET pwd="' . $pwd . '" WHERE uname="' . $name . '"', "", true);
        }
    } else {
        header("Location:login.php");
    }
} else {
    header("Location:login.php");
}
?>
    </body>
</html>
開發者ID:Kuludu,項目名稱:HR-management,代碼行數:29,代碼來源:member.php

示例3: htmlspecialchars

functions::chk_code();
if (!empty($_POST["uname"]) && !empty($_POST["pwd"])) {
    $name = htmlspecialchars($_POST["uname"]);
    $pwd = htmlspecialchars($_POST["pwd"]);
    $admin = functions::mysql_query("SELECT admin FROM " . TABLE_PREFIX . "_setting", "admin", false);
    if ($name === $admin) {
        $admin_pwd = functions::mysql_query("SELECT safe_code FROM " . TABLE_PREFIX . "_setting", "safe_code", false);
        if ($admin_pwd === $pwd) {
            functions::register_session($name);
            header('Location: admin.php');
            exit;
        } else {
            die("<center>賬戶或密碼錯誤</center>");
        }
    }
    $is_exit = functions::mysql_query('SELECT count(*) FROM ' . TABLE_PREFIX . '_members WHERE uname="' . $name . '"', "count(*)", false);
    if ($is_exit == 0) {
        die("<center>賬戶或密碼錯誤</center>");
    } else {
        $rpwd = functions::mysql_query('SELECT pwd FROM ' . TABLE_PREFIX . '_members WHERE uname="' . $name . '"', "pwd", false);
    }
    if ($pwd === $rpwd) {
        functions::register_session($name);
        header('Location: member.php?name=' . $name);
    } else {
        die("<center>賬戶或密碼錯誤</center>");
    }
}
?>
</body>
</html>
開發者ID:Kuludu,項目名稱:HR-management,代碼行數:31,代碼來源:login.php

示例4: MAX

                <img src="validatecode.php" title="看不清,點擊換一張" onclick="this.src = 'validatecode.php?' + Math.random();"></center> 
            <center><input type="submit" value="提交"></input></center>
            <form>
                <?php 
/*
 * 檢測重名尚未完成
 */
functions::chk_code();
if (!empty($_POST["name"])) {
    $icount = functions::mysql_query("SELECT MAX(id) FROM " . TABLE_PREFIX . "_applicant", "MAX(id)", false);
    $nowid = $icount + 1;
    $name = htmlspecialchars($_POST["name"]);
    functions::mysql_query("INSERT INTO " . TABLE_PREFIX . '_applicant(`id`,`name`,`ips`,`pass`) VALUES(' . $nowid . ',"' . $name . '","' . $vistorip . '","false")', "", true);
    $answers = array();
    for ($id = 1; $id <= $qcount; $id++) {
        $answer = htmlspecialchars($_POST["q" . $id]);
        $question = functions::mysql_query("SELECT question FROM " . TABLE_PREFIX . "_questions WHERE id=" . $id, "question", false);
        $data = '<center>問題:' . $question . '       回答:' . $answer . '</center></br>';
        $answers[$id] = $data;
    }
    $word = implode("", $answers);
    $file = '<?php echo "' . $word . '"; ?>';
    $f_open = fopen($path . "/applicant/" . $nowid . ".php", "w");
    fwrite($f_open, $file);
    fclose($f_open);
    echo '<script>alert("成功提交申請");</script>';
    die('<center>提交成功,請等待審核</center>');
}
?>
                </body>
                </html>
開發者ID:Kuludu,項目名稱:HR-management,代碼行數:31,代碼來源:applicant.php


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