本文整理汇总了PHP中guolv函数的典型用法代码示例。如果您正苦于以下问题:PHP guolv函数的具体用法?PHP guolv怎么用?PHP guolv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了guolv函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trim
$head .= "\r\n";
$head .= trim($query);
$write = fputs($fp, $head);
$header = "";
while ($str = trim(fgets($fp, 4096))) {
$header .= $str;
}
while (!feof($fp)) {
$data .= fgets($fp, 4096);
}
return $data;
}
//密码找回
if ($_POST) {
$phone = guolv(trim($_POST['phone']));
$code = guolv(trim($_POST['code']));
if (is_phone($phone) == false) {
echo "<script>alert('请输入正确的手机号');location.href='find.php'</script>";
exit;
}
if ($code !== $_SESSION['code']) {
echo "<script>alert('验证码错误,请重新输入');location.href='find.php'</script>";
exit;
}
$row = $mysql->query("select * from `userdata` where `phone`='{$phone}' limit 1");
if ($row) {
$rand = rand(1, 9999);
$mysql->execute("update `userdata` set `pass`='{$rand}' where `phone`='{$phone}'");
$apikey = "5b4aa85957d6b5ce942ac4c9e8e343fe";
//请用自己的apikey代替
$text = "正在找回密码,您的密码是#{$rand}#";
示例2: guolv
$tc = guolv($_POST['tc']);
$iphour = guolv($_POST['iphour']);
$fangwen = guolv($_POST['fangwen']);
$area = guolv($_POST['area']);
$city = guolv($_POST['city']);
$weixin_reg = guolv($_POST['weixin_reg']);
$daysong = guolv($_POST['daysong']);
$ipreg2 = guolv($_POST['ipreg2']);
$reg_yzr1 = guolv($_POST['reg_yzr1']);
$gotimes = guolv($_POST['gotimes']);
$AdminLoginCode = guolv($_POST['AdminLoginCode']);
$AdminEmail = guolv($_POST['AdminEmail']);
$UserAddArticle = guolv($_POST['UserAddArticle']);
$UserAddArticleType = guolv($_POST['UserAddArticleType']);
$DetailMoreNum = guolv($_POST['DetailMoreNum']);
$DetailPvOpen = guolv($_POST['DetailPvOpen']);
$arr = array('site' => $site, 'sharesite' => $sharesite, 'ti' => $ti, 'p1' => $p1, 'pp' => $pp, 'song' => $song, 'openreg' => $openreg, 'sitename' => $sitename, 'kou_pr' => $kou_pr, 'kou_day' => $kou_day, 'kou_hour' => $kou_hour, 'yunpian' => $yunpian, 'safe' => $safe, 'qqkf' => $qqkf, 'tc' => $tc, 'iphour' => $iphour, 'fangwen' => $fangwen, 'area' => $area, 'city' => $city, 'weixin_reg' => $weixin_reg, 'daysong' => $daysong, 'ipreg2' => $ipreg2, 'reg_yzr1' => $reg_yzr1, 'gotimes' => $gotimes, 'AdminLoginCode' => $AdminLoginCode, 'AdminEmail' => $AdminEmail, 'UserAddArticle' => $UserAddArticle, 'UserAddArticleType' => $UserAddArticleType, 'DetailMoreNum' => $DetailMoreNum, 'DetailPvOpen' => $DetailPvOpen);
$config = var_export($arr, true);
file_put_contents('../config.php', "<?php\nreturn {$config};\n?>");
//print_r($arr);
echo "<script>alert('修改成功');location.href='set.php'</script>";
exit;
}
//扣量
if ($_POST['do'] == 'kou') {
}
?>
<?php
include 'head.php';
?>
示例3: session_start
<?php
session_start();
require '../conn.php';
require '../functions.php';
require '../QueryList.class.php';
require 'admin.php';
if ($_POST) {
$long = guolv(trim($_POST['long']));
$type_arr = explode('#', guolv($_POST['type']));
$type = $type_arr[0];
$money = $type_arr[1];
$html = get_contents($long);
$html = str_replace('data-src', 'src', $html);
$vid = cut($html, 'vid=', '&');
//获取视频ID
$caiji = array("title" => array(".rich_media_title:first", "text"), "content" => array("#js_content", "html"));
$quyu = '';
$hj = QueryList::Query($html, $caiji, $quyu);
$arr = $hj->jsonArr;
$title = $arr[0]['title'];
$content = preg_replace("/<(\\/?i?frame.*?)>/si", "", $arr[0]['content']);
//过滤frame标签
if ($vid !== '') {
$content = "<p><iframe height=300 width=100% src=\"http://v.qq.com/iframe/player.html?vid={$vid}\" frameborder=0 allowfullscreen></iframe></p>" . $content;
}
$pic = cut($html, 'var msg_cdn_url = "', '"');
if (url_exists($long) == 1) {
echo "<script>alert('网址不存在');location.href='weixin.php'</script>";
exit;
}
示例4: guolv
<?php
require 'conn.php';
require 'session.php';
require 'functions.php';
$id = guolv($_GET['id']);
//print_r($userdata);
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<title>新闻-<?php
echo $config['sitename'];
?>
</title>
<link href="<?php
echo $site;
?>
/static/all.css" type="text/css" rel="stylesheet" media="all">
<style>
td{border-bottom:1px solid #ddd;height:40px;line-height:40px;font-size:14px;color:#333;}
.mhome{background:#fff;}
</style>
</head>
<body class="mhome">
<?php
include 'header.php';
示例5: guolv
$mysql->query("delete from `addata` where `id`='{$del_id}'");
echo "<script>alert('删除成功');location.href='adlist.php'</script>";
exit;
}
//发布广告
if ($_POST) {
if ($_POST['do'] == 'ad') {
$ad_content = guolv($_POST['ad_content']);
}
if ($_POST['do'] == 'js') {
$ad_content = guolv($_POST['ad_content_js']);
}
$ad_type = guolv($_POST['ad_type']);
$ad_list = guolv($_POST['ad_list']);
//$ad_pv=guolv($_POST['ad_pv']);
$ad_endtime = guolv($_POST['ad_endtime']);
if ($ad_type !== '' && $ad_content !== '' && $ad_endtime !== '') {
// if($ad_pv!=='' && $ad_endtime!==''){
// echo "<script>alert('点击次数/到期时间,只能二选其一,空着即可');location.href='adlist.php'</script>";
// exit;
// }
$row = $mysql->query("select * from `addata` where `ad_type`='{$ad_type}' and `ad_list`='{$ad_list}' limit 1");
if ($row) {
echo "<script>alert('广告已经存在请先删除');location.href='adlist.php'</script>";
exit;
}
$arr = array('ad_type' => $ad_type, 'ad_content' => $ad_content, 'ad_list' => $ad_list, 'pv' => $ad_pv, 'endtime' => $ad_endtime);
$value = arr2s($arr);
$mysql->query("insert into `addata` {$value}");
echo "<script>alert('增加成功');location.href='adlist.php'</script>";
exit;
示例6: guolv
$page_1 = $page - 1;
} else {
$page_1 = 1;
$min = 0;
$page_2 = 2;
}
}
$max = $page * 35;
$row = $mysql->query("select * from `refererdata` order by `id` desc limit {$min},{$max}");
//查看分享记录
$uid = guolv($_GET['uid']);
if (is_numeric($uid)) {
$row = $mysql->query("select * from `refererdata` where `uid`='{$uid}' order by `id` desc limit {$min},{$max}");
}
//查看ip
$kip = guolv($_GET['ip']);
if (is_ip($kip)) {
$row = $mysql->query("select * from `refererdata` where `ip`='{$kip}' order by `id` desc limit {$min},{$max}");
}
?>
<script>
function parseip(remote_ip_info,ip){
if(remote_ip_info.ret=='-1')
{
$("span[ip='"+ip+"']").html('局域网地址');
}
else
{
var data = '';
//if(remote_ip_info.country !='') data = remote_ip_info.country + ',';
if(remote_ip_info.province !='') data = data + remote_ip_info.province + ',';
示例7: exit
require 'functions.php';
//全站访问
if ($config['fangwen'] == 4) {
exit('网站正在更新');
}
$ip = GetIP();
$day = date("Y-m-d", time());
$time = time();
if ($_SESSION['login'] == 1) {
_location("ucenter.php", 301);
exit;
}
//登录验证
if ($_POST) {
$phone = guolv(trim($_POST['phone']));
$password = guolv(trim($_POST['password']));
//$code=guolv(trim($_POST['code']));
if (is_phone($phone) == false) {
echo "<script>alert('请输入正确的手机号');location.href='login.php'</script>";
exit;
}
if ($password == '') {
echo "<script>alert('请输入密码');location.href='login.php'</script>";
exit;
}
// if($code!==$_SESSION['code']){
// echo "<script>alert('验证码错误,请重新输入');location.href='login.php'</script>";
// exit;
// }
$row = $mysql->query("select * from `userdata` where `phone`='{$phone}' and `pass`='{$password}' limit 1");
if ($row) {
示例8: guolv
//注册
$tj_id = guolv(trim($_POST['tj_id']));
//推荐人
if (is_numeric($tj_id)) {
$row_tj = $mysql->query("select * from `userdata` where `id` in({$tj_id})");
if (!$row_tj) {
$tj_id = 0;
}
} else {
$tj_id = 0;
}
if ($_POST) {
$phone = guolv(trim($_POST['username']));
$pass = guolv(trim($_POST['password']));
// $code=guolv(trim($_POST['code']));
$yzm = guolv(trim($_POST['yzm']));
$yzm1 = substr($phone, 3, 4);
if ($config['openreg'] == 0) {
echo "<script>alert('注册关闭,请联系我们');location.href='reg.php'</script>";
exit;
}
if ($config['ipreg2'] == 1) {
$row_ip = $mysql->query("select * from `userdata` where `ip`='{$ip}' order by `id` limit 1");
//获取相同ip
if ($row_ip) {
echo "<script>alert('为防止同一人注册多个号,禁止同一ip重复注册!');location.href='reg.php'</script>";
exit;
}
}
if (is_phone($phone) == false) {
echo "<script>alert('请输入正确的手机号');location.href='reg.php'</script>";
示例9: session_start
<?php
session_start();
require '../conn.php';
require '../functions.php';
require 'admin.php';
if ($_POST) {
//新闻发布
$news_title = guolv($_POST['news_title']);
$news_content = guolv($_POST['news_content']);
$time = time();
if ($news_title !== '' && $news_content !== '') {
$mysql->query("insert into `newsdata` values(null,'{$news_title}','{$news_content}')");
$id = mysql_insert_id();
if ($id !== 0) {
echo "<script>alert('发布成功!');location.href='newslist.php'</script>";
}
//_location("set.php",301);
exit;
}
}
?>
<?php
include 'head.php';
?>
<link rel="stylesheet" href="../editor/themes/default/default.css" />
<link rel="stylesheet" href="../editor/plugins/code/prettify.css" />
<script src="static/jquery.js" type="text/javascript"></script>
<script charset="utf-8" src="../editor/kindeditor.js"></script>
示例10: session_start
<?php
session_start();
require '../conn.php';
require '../functions.php';
require 'admin.php';
//删除
$del_id = guolv($_GET['del_id']);
if (is_numeric($del_id)) {
$mysql->query("delete from `newsdata` where `id`='{$del_id}'");
echo "<script>alert('删除成功');location.href='newslist.php'</script>";
}
?>
<?php
include 'head.php';
?>
<div class="container-fluid">
<div class="row-fluid">
<?php
include 'left.php';
?>
<div class="span9">
<h1 class="page-title">新闻管理</h1>
<!--
<div class="btn-toolbar">
<a href="#myModal" data-toggle="modal" class="btn">Delete</a>
<div class="btn-group">
示例11: session_start
<?php
session_start();
require '../conn.php';
require '../functions.php';
require 'admin.php';
$id = guolv($_GET['id']);
if (is_numeric($id)) {
$row = $mysql->query("select * from `newsdata` where `id` in({$id})");
}
if ($_POST) {
//新闻修改
$news_title = guolv($_POST['news_title']);
$news_content = guolv($_POST['news_content']);
$news_id = guolv($_POST['news_id']);
$time = time();
if ($news_title !== '' && $news_content !== '') {
$mysql->query("update `newsdata` set `title`='{$news_title}',`content`='{$news_content}' where `id`='{$news_id}'");
echo "<script>alert('发布成功!');location.href='newslist.php'</script>";
//_location("set.php",301);
exit;
}
}
?>
<?php
include 'head.php';
?>
<link rel="stylesheet" href="../editor/themes/default/default.css" />
<link rel="stylesheet" href="../editor/plugins/code/prettify.css" />
示例12: guolv
if (is_numeric($del_id)) {
$mysql->query("delete from `article` where `id`='{$del_id}'");
echo "<script>alert('删除成功');location.href='all_article.php'</script>";
exit;
}
//搜索
if ($_GET['do'] == 'search') {
$search_title = guolv($_GET['search_title']);
$row = $mysql->query("select * from `article` where `title` LIKE '%{$search_title}%' limit 1");
}
//排序
if ($_GET['order'] == 'pv') {
$row = $mysql->query("select * from `article` order by -`pv`");
}
//日期
$search_day = guolv($_GET['day']);
if (preg_match("/\\d{4}-1[0-2]|0?[1-9]-0?[1-9]|[12][0-9]|3[01]/", $search_day)) {
$row = $mysql->query("select * from `article` where `day`='{$search_day}'");
}
?>
<?php
include 'head.php';
?>
<script type="text/javascript">
function check_all(obj,cName)
{
var checkboxs = document.getElementsByName(cName);
for(var i=0;i<checkboxs.length;i++){checkboxs[i].checked = obj.checked;}
}
示例13: guolv
$admin_username = guolv($_POST['admin_username']);
$admin_password = guolv($_POST['admin_password']);
$admin_q = guolv($_POST['admin_q']);
$row = $mysql->query("select * from `admindata` where `username`='{$admin_username}' limit 1");
if (!$row) {
$mysql->query("insert into `admindata` values(null,'{$admin_username}','{$admin_password}','{$admin_q}')");
$id = mysql_insert_id();
if ($id !== 0) {
echo "<script>alert('增加成功!');location.href='set_admin.php'</script>";
exit;
}
}
}
//管理员删除
if (is_numeric($_GET['del_admin'])) {
$del_admin = guolv($_GET['del_admin']);
$mysql->query("delete from `admindata` where `id`='{$del_admin}'");
echo "<script>alert('删除成功!');location.href='set_admin.php'</script>";
exit;
}
?>
<?php
include 'head.php';
?>
<div class="container-fluid">
<div class="row-fluid">
<?php
include 'left.php';
示例14: guolv
<?php
require 'conn.php';
require 'session.php';
require 'functions.php';
//print_r($session);
//修改资料
if ($_POST) {
$pass_old = guolv(trim($_POST['pass_old']));
$pass_new = guolv(trim($_POST['pass_new']));
$pass_new1 = guolv(trim($_POST['pass_new1']));
$uid = guolv(trim($_POST['uid']));
if ($pass_old !== '' && $pass_new !== '' && $pass_new1 !== '') {
if ($pass_old !== $session['pass']) {
echo "<script>alert('用户原密码不正确');location.href='editpwd.php'</script>";
exit;
}
if ($pass_new !== $pass_new1) {
echo "<script>alert('两次输入的密码不正确');location.href='editpwd.php'</script>";
exit;
}
$mysql->execute("update `userdata` set `pass`='{$pass_new}' where `id`='{$uid}'");
echo "<script>alert('修改成功请重新登录');location.href='session.php?do=exit'</script>";
exit;
} else {
echo "<script>alert('请输入完整信息');location.href='editpwd.php'</script>";
exit;
}
}
?>
示例15: guolv
<?php
require 'conn.php';
require 'session.php';
require 'functions.php';
//print_r($session);
//修改资料
if ($_POST) {
//$wx=guolv(trim($_POST['wx']));
//$pass=guolv(trim($_POST['pass']));
$uid = guolv(trim($_POST['uid']));
$realname = guolv(trim($_POST['realname']));
$alipay = guolv(trim($_POST['alipay']));
$phone = guolv(trim($_POST['phone']));
$wx = guolv(trim($_POST['wx']));
if ($userdata['realname'] !== '' && $userdata['alipay'] !== '' && $userdata['phone'] !== '') {
echo "<script>alert('收款姓名、支付宝、手机号,一经填写不得修改!');location.href='zl.php'</script>";
exit;
}
if ($alipay == '' || $realname == '' || $phone == '') {
echo "<script>alert('请填写每一项内容,一经填写不得修改!');location.href='zl.php'</script>";
exit;
}
if (is_phone($phone) == false) {
echo "<script>alert('请输入正确的手机号');location.href='zl.php'</script>";
exit;
}
$row = $mysql->query("select * from `userdata` where `alipay`='{$alipay}' limit 1");
if ($row) {
echo "<script>alert('支付宝已经被注册');location.href='zl.php'</script>";
exit;