本文整理汇总了PHP中front::post方法的典型用法代码示例。如果您正苦于以下问题:PHP front::post方法的具体用法?PHP front::post怎么用?PHP front::post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类front
的用法示例。
在下文中一共展示了front::post方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_mytable
private function check_mytable() {
if(!preg_match('/^my_.+/',front::post('name'))) {
front::flash('表名格式必须是是"my_abc"!');
return false;
}
return true;
}
示例2: clear_action
function clear_action() {
if (front::post('batch') == 'clear') {
$delete=$this->_table->rec_delete("true");
if ($delete >0) front::flash("成功删除{$this->tname}!");
}
front::redirect(front::$from);
}
示例3: manage_action
function manage_action() {
if(!config::get('sms_username') || !config::get('sms_password')){
echo '<script>alert("您需要先设置用户名和密码才能使用短信管理功能!");window.location.href="'.url('config/system/set/sms').'";</script>';
exit;
}
include_once("phprpc/phprpc_client.php");
$client = new PHPRPC_Client();
$client->setProxy(NULL);
$client->useService('http://pay.cmseasy.cn/sms.php');
$client->setKeyLength(128);
$client->setEncryptMode(3);
$info = $client->getInfo(config::get('sms_username'),md5(config::get('sms_password')));
$info[0] = intval($info[0]);
$info[1] = intval($info[1]);
$this->view->info = $info;
if (front::post('submit')) {
if (front::post('act') == 'test') {
$rs = sendMsg(front::post('mobile'),'test');
if($rs->SendSMSResult == '0'){
front::flash('发送成功');
}else{
front::flash('发送失败,请检查用户名、密码或剩余条数');
}
}
}else{
if($info[0] < 50) front::flash('你的剩余短信不足50条,请及时充值');
}
}
示例4: index_action
function index_action() {
if (front::post('submit')) {
if (!front::post('ballot')) {
front::alert(lang('Please_select_vote'));
return false;
}
if (config::get('checkip')) {
$time=cookie::get('vttime');
if (time() -$time <config::get('timer') * 60) {
front::alert(lang('You_have_voted'));
return false;
}
}
$bid=front::$post['bid'];
if (is_array(front::$post['ballot'])) {
$ids=implode(',',front::$post['ballot']);
}
else {
$ids=front::$post['ballot'];
}
if(preg_match('/(select|union|and|\'|"|\))/i',$ids)){
exit('非法参数');
}
if(preg_match('/(select|union|and|\'|"|\))/i',$bid)){
exit('非法参数');
}
$where="id in($ids)";
$data='num=num+1';
$option=new option();
$option->rec_update($data,$where);
$this->_table->rec_update($data,$bid);
cookie::set('vttime',time(),time() +3600 * 24);
front::alert(lang('Successful_vote'));
}
}
示例5: vaild
function vaild() {
if (!front::post('name')) {
front::flash('请填写名称!');
return false;
}
return true;
}
示例6: add_action
function add_action() {
if(front::post('submit') &&front::post('aid')) {
if(config::get('verifycode')) {
if(front::post('verify')<>session::get('verify')) {
alertinfo('验证码错误。', front::$from);
//front::redirect(front::$from);
}
}
if(!front::post('username')) {
/*front::flash(lang('请留下你的名字!'));
front::redirect(front::$from);*/
alertinfo('请留下你的名字!', front::$from);
}
if(!front::post('content')) {
/*front::flash(lang('请填写评论内容!'));
front::redirect(front::$from);*/
alertinfo('请填写评论内容!', front::$from);
}
$this->manage->filter();
$comment=new comment();
$archive=new archive();
front::$post['state'] = '0';
front::$post['adddate']=date('Y-m-d H:i:s');
$comment->rec_insert(front::$post);
$archive->rec_update('comment=comment+1',front::post('aid'));
//front::flash(lang('提交成功!'));
alertinfo('评论提交成功。', front::$from);
//front::redirect(front::$from);
}else {
front::flash(lang('提交失败!'));
front::redirect(front::$from);
}
}
示例7: batch_action
function batch_action(){
if(front::post('batch') == 'delete'){
$sql = "DELETE FROM `".config::get('database', 'prefix')."event`";
$this->_table->query($sql);
event::log('日志清除','成功');
front::refresh(url::modify('act/manage',true));
}
}
示例8: edit_action
function edit_action() {
$path=ROOT.'/lang/'.config::get('lang_type').'/system.php';
$tipspath=ROOT.'/lang/cn/system.php';
if (front::post('submit')) {
$content=file_get_contents($path);
$to_delete_items=front::$post['to_delete_items'];
unset(front::$post['to_delete_items']);
foreach (front::$post as $key=>$val) {
preg_match_all("/'".$key."'=>'(.*?)',/",$content,$out);
if (is_array($to_delete_items) && in_array($key,$to_delete_items))
$content=str_replace($out[0][0],'',$content);
else
$content=str_replace($out[1][0],$val,$content);
}
file_put_contents($path,$content);
if ($_GET['site'] != 'default') {
$ftp=new nobftp();
$ftpconfig=config::get('website');
$ftp->connect($ftpconfig['ftpip'],$ftpconfig['ftpuser'],$ftpconfig['ftppwd'],$ftpconfig['ftpport']);
$ftperror=$ftp->returnerror();
if ($ftperror) {
exit($ftperror);
}
else {
$ftp->nobchdir($ftpconfig['ftppath']);
$ftp->nobput($ftpconfig['ftppath'].'/lang/'.config::get('lang_type').'/system.php',$path);
}
}
unset($content);
event::log('修改语言包','成功');
echo '<script type="text/javascript">alert("操作完成!");window.location.href="'.url('language/edit',true).'";</script>';
}
$content=include($path);
$tips=include($tipspath);
$this->view->tips=$tips;
//分页
$limit = 30;
if(!front::get('page'))
$page = 1;
else
$page = front::get('page');
$total = ceil(count($content)/$limit);
if($page < 1) $page = 1;
if($page > $total) $page = $total;
$start = ($page-1) * $limit;
$end = $start+$limit-1;
$tmp = range($start,$end);
$list_content_arr = array();
$i = 0;
foreach($content as $k => $v){
if(in_array($i++,$tmp))
$list_content_arr[$k] = $v;
}
$this->view->sys_lang=$list_content_arr;
$this->view->link_str = listPage($total,$limit,$page);
}
示例9: save_after
function save_after($typeid) {
if(front::$post['_ranks']) {
$_ranks=serialize(front::post('_ranks'));
$rank=new rank();
if(is_array($rank->getrow(array('typeid'=>front::get('id')))))
$rank->rec_update(array('ranks'=>$_ranks),'typeid='.$typeid);
else
$rank->rec_insert(array('typeid'=>front::get('id'),'ranks'=>$_ranks));
}
else {
$rank=new rank();
$rank->rec_delete('typeid='.$typeid);
}
}
示例10: mail_before
function mail_before() {
$user = new user();
$user_arr = front::post('select');
if(is_array($user_arr)) {
foreach ($user_arr as $id) {
$row = $user->getrow($id);
$echo .= $row['username'].' ['.$row['e_mail'].'],';
}
echo $echo;
}else {
$row = $user->getrow(front::get('id'));
echo $row['username'].' ['.$row['e_mail'].']';
}
}
示例11: login_action
function login_action() {
cookie::del('passinfo');
//$_SESSION['test'] = 'test';
$this->view->loginfalse=cookie::get('loginfalse'.md5($_SERVER['REQUEST_URI']));
if (front::post('submit')) {
if ($this->view->loginfalse) {
if (!session::get('verify') ||front::post('verify') <>session::get('verify')) {
front::flash('验证码错误!');
$this->render();
exit;
}
}
$user=new user();
$user=$user->getrow(array('username'=>front::post('username'),'password'=>md5(front::post('password'))));
if (is_array($user)) {
$roles = usergroup::getRoles($user['groupid']);
session::set('roles',null);
if($roles){
front::$isadmin=true;
session::set('roles',$roles);
}else{
front::alert('无权登录后台');
}
if(!front::post('expire')){
cookie::set('login_username',$user['username']);
cookie::set('login_password',front::cookie_encode($user['password']));
}else{
$expire = time() + front::post('expire');
cookie::set('login_username',$user['username'],$expire);
cookie::set('login_password',front::cookie_encode($user['password']),$expire);
}
session::set('username',$user['username']);
event::log('后台登录','成功');
require_once ROOT.'/celive/include/config.inc.php';
require_once ROOT.'/celive/include/celive.class.php';
$login=new celive();
$login->auth();
$GLOBALS['auth']->login(front::post('username'),front::post('password'));
$GLOBALS['auth']->check_login1();
front::$user=$user;
}elseif (!is_array(front::$user) ||!isset(front::$isadmin)) {
cookie::set('loginfalse'.md5($_SERVER['REQUEST_URI']),(int) cookie::get('loginfalse'.md5($_SERVER['REQUEST_URI'])) +1,time() +3600);
event::log('loginfalse','失败 user='.front::post('username'));
front::flash('密码错误或不存在该管理员!');
front::refresh(url('admin/login',true));
}
}
$this->render();
}
示例12: editwebsite_action
function editwebsite_action() {
chkpw('website_edit');
if (front::post('submit')) {
$var = front::$post;
$path = ROOT.'/config/website/'.front::$post['path'].'.php';
$contenttmp = file_get_contents(ROOT.'/config/config.example.php');
if (is_array($var))
foreach ($var as $key=>$value) {
$value=str_replace("'","\'",$value);
$contenttmp=preg_replace("%(\'$key\'=>)\'.*?\'(,\s*//)%i","$1'$value'$2",$contenttmp);
}
@file_put_contents($path,$contenttmp);
//echo '<script type="text/javascript">alert("操作完成!")</script>';
front::refresh(url('website/listwebsite',true));
}
$path = ROOT.'/config/website/'.front::$get['id'].'.php';
$datatmp = include $path;
$this->view->data = $datatmp;
}
示例13: dbfield_select_action
function dbfield_select_action() {
$res=array();
$res['content']=' 没有可以进行替换的字段。';
$table=front::post('stable');
if(@class_exists($table)) {
$table=new $table;
$_fields=array();
foreach($table->getFields() as $field) {
if(preg_match('/text|var/',$field['type']) &&!preg_match('/^[a-zA-Z_]+$/',lang($field['name'])))
$_fields[]=$field['name'];
}
$fields=array(0=>null);
foreach($_fields as $field) $fields[$field]=lang($field);
if(count($_fields)>0)
$res['content']=' 字段=>'.form::select('sfield',0,$fields,'style="font-size:16px"');
}
$res['id']='fieldlist';
echo json::encode($res);
exit;
}
示例14: downfile_action
function downfile_action() {
$base_url = config::get('base_url');
if(front::post('submit')) {
if(!session::get('verify') ||front::post('verify')<>session::get('verify')) {
front::flash(lang('验证码错误!'));
return;
}else {
front::check_type(front::get('aid'));
$aid=front::get('aid');
$name=archive_attachment($aid,'intro');
$path=archive_attachment($aid,'path');
if(!$name) $name=preg_replace('%(.*)[\\\\\/](.*)_\d+(\.[a-z]+)$%i','$2',$path);
@cookie::set('allowdown',md5(url::create('attachment/downfile/aid/'.$aid.'/v/ce')));
if(!rank::arcget($aid,$this->view->usergroupid,'down'))
$link="<p align='center'><a id='att' href='javascript:alert(\"未取得授权,无法下载!\");'><img src='{$base_url}/images/download.gif' alt='$name' border='0' /></a></p>";
else $link="<p align='center'><a id='att' href='".url::create('attachment/down/aid/'.$aid)."'><img src='{$base_url}/images/download.gif' alt='$name' border='0' /></a></p>";
echo $link;
exit;
}
}
}
示例15: do_action
function do_action() {
if(front::post('submit') &&front::post('vote') &&front::post('aid')) {
front::check_type(front::post('aid'));
if(!isset($this->view->user)) front::flash(lang('请登陆!'));
$vote=new vote();
$_vote=$vote->getrow('aid='.front::post('aid'));
if(eregi($this->view->user['username'].',',$_vote['users'])) {
front::flash(lang('不能重复投票!'));
front::redirect(front::$from);
}
$_votes=$_vote['votes'];
if(!$_votes) $_votes=array();
else $_votes=unserialize($_votes);
$_votes[front::post('vote')]=$_votes[front::post('vote')]+1;
$votes=serialize($_votes);
$vote_data=array_merge($_vote,array('votes'=>$votes,'aid'=>front::post('aid'),'users'=>$_vote['users'].$this->view->user['username'].','));
$vote->rec_replace($vote_data,front::post('aid'));
front::flash(lang('投票成功!'));
}else {
front::flash(lang('投票失败!'));
}
front::redirect(front::$from);
}