本文整理汇总了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>
示例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>
示例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>
示例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>