本文整理汇总了PHP中url::create方法的典型用法代码示例。如果您正苦于以下问题:PHP url::create方法的具体用法?PHP url::create怎么用?PHP url::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类url
的用法示例。
在下文中一共展示了url::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: url
function url($tag,$page=1) {
if(front::$get['t'] == 'wap'){
if(config::get('tag_html')){
$otag = new tag();
$row = $otag->getrow("tagname='$tag'");
$tagid= $row['tagid'];
$pinyin = pinyin::get($tag);
return config::get('base_url').'/tags_wap/'.$pinyin.'_'.$tagid.'_'.$page.'.html';
}
if(front::$rewrite){
return config::get('base_url').'/tags_wap_'.urlencode($tag).'_'.$page.'.htm';
}
return url::create('tag/show/t/wap/tag/'.urlencode($tag).($page>1?'/page/'.$page:''),false);
}
if(config::get('tag_html')){
$otag = new tag();
$row = $otag->getrow("tagname='$tag'");
$tagid= $row['tagid'];
$pinyin = pinyin::get($tag);
return config::get('base_url').'/tags/'.$pinyin.'_'.$tagid.'_'.$page.'.html';
}
if(front::$rewrite){
return config::get('base_url').'/tags_'.urlencode($tag).'_'.$page.'.htm';
}
return url::create('tag/show/tag/'.urlencode($tag).($page>1?'/page/'.$page:''),false);
}
示例2: dorestore_action
function dorestore_action() {
$dir=ROOT.'/data/'.front::get('db_dir');
if(is_dir($dir)) {
$db_files=front::scan($dir);
foreach($db_files as $db_file) {
if(!preg_match('/^\./',$db_file)) tdatabase::getInstance()->restoreTables($dir.'/'.$db_file);
}
front::flash('数据库还原成功!');
}
front::redirect(url::create('database/restore'));
}
示例3: logout_action
function logout_action() {
cookie::del('login_username');
cookie::del('login_password');
session::del('username');
session::del('roles');
require_once ROOT.'/celive/include/config.inc.php';
require_once ROOT.'/celive/include/celive.class.php';
$login=new celive();
$login->auth();
$GLOBALS['auth']->logout();
$GLOBALS['auth']->check_logout1();
front::redirect(url::create('index'));
}
示例4: check_admin
function check_admin() {
if (cookie::get('login_username')&&cookie::get('login_password')) {
$user=new user();
$user=$user->getrow(array('username'=>cookie::get('login_username')));
$roles = session::get('roles');
if ($roles && is_array($user)&&cookie::get('login_password')==front::cookie_encode($user['password'])) {
$this->view->user=$user;
front::$user=$user;
}else{
$user=null;
}
}
if (!isset($user)||!is_array($user)) {
front::redirect(url::create('admin/login'));
}
}
示例5: url
function url($spid,$ishtml,$page=1) {
$ishtml = special::getishtml($spid);
if(front::$get['t'] == 'wap'){
if($ishtml){
return config::get('site_url').'special_wap/'.$spid.'/list_'.$page.'.html';
}else{
return url::create('special/show/t/wap/spid/'.$spid.($page >1 ?'/page/'.$page : ''),false);
}
}
if(!$ishtml && !front::$rewrite){
return url::create('special/show/spid/'.$spid.($page >1 ?'/page/'.$page : ''),false);
}else if(front::$rewrite){
return config::get('site_url').'speciallist_'.$spid.'_'.$page.'.htm';
}else{
return config::get('site_url').'special/'.$spid.'/list_'.$page.'.html';
}
}
示例6: js
static function js($tagid) {
if (!is_numeric($tagid)) {
$tagid="name='$tagid'";
$tag=self::getInstance()->getrow($tagid);
$tagid=$tag['id'];
}
$url=url::create("templatetag/get/id/$tagid/".url::arrayto(array_slice(front::$get,2)));
return "<script src=\"$url\"></script>";
}
示例7: guestadd_action
function guestadd_action() {
if($this->view->guestuser) {
echo '<script type="text/javascript">
alert("'.lang('你已经登录,自动跳转到会员发布页面!').'");
window.location.href="'.url::create('/manage/add/manage/archive').'";
</script>';
}
if(front::post('submit') &&$this->manage->vaild()) {
$this->manage->filter();
$this->manage->save_before();
//front::$post['title']=addslashes(front::$post['title']);
front::$post['checked']=0;
front::$post['userid']='-999';
front::$post['username']='guest';
front::$post['author']='guest';
front::$post['adddate']=date('Y-m-d H:i:s');
front::$post['ip']=front::ip();
$data=array();
$fieldlimit=$this->_table->getcols(front::$act=='list'?'user_manage':'user_modify');
$fieldlimits=explode(',',$fieldlimit);
foreach(front::$post as $key=>$value) {
if(in_array($key,$fieldlimits))
$data[$key]=$value;
}
$data=array_merge($data,front::$post);
$insert=$this->_table->rec_insert($data);
if($insert<1) {
front::flash(lang('记录添加失败!'));
}
else {
front::flash(lang('记录添加成功!'));
if($this->table== 'archive')
front::redirect(url::create('/manage/guestlist/manage/archive/needcheck/1/guest/1'));
}
}
$this->_view_table=$this->_table->getrow(null,0,null,$this->_table->getcols('user_modify'));
$this->_view_table['data']=array();
}
示例8: register_action
//.........这里部分代码省略.........
return;
}
if(strlen(front::post('username'))<4) {
front::flash(lang('用户名太短!'));
return;
}
if(strlen(front::post('e_mail'))<1) {
front::flash(lang('请填写邮箱!'));
return;
}
if(strlen(front::post('tel'))<1) {
front::flash(lang('请填写手机号码!'));
return;
}
if(front::post('username') &&front::post('password')) {
$username=front::post('username');
$password=md5(front::post('password'));
$e_mail=front::post('e_mail');
$tel=front::post('tel');
if(!preg_match('/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/', front::ip())&&!preg_match('@^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))(%.+)?\s*$@', front::ip())){
exit('来源非法');
}
$data=array(
'username'=>$username,
'password'=>$password,
'e_mail'=>$e_mail,
'tel'=>$tel,
'groupid'=>101,
'userip'=>front::ip()
);
//phpox 2011-06-10
foreach($this->view->field as $f){
$name=$f['name'];
if(!preg_match('/^my_/',$name)) {
unset($field[$name]);
continue;
}
if(!setting::$var['user'][$name]['showinreg']) {
continue;
}
$data[$name] = front::post($name);
}
if($this->_user->getrow(array('username'=>$username))) {
front::flash(lang('该用户名已被注册!'));
return;
}
$insert=$this->_user->rec_insert($data);
$_userid = $this->_user->insert_id();
if($insert){
if(config::get('sms_on') && config::get('sms_reg_on')){
sendMsg($tel,config::get('sms_reg'));
}
$cmsname = config::get('sitename');
if(config::get('email_reg_on')){
$this->sendmail($e_mail,"欢迎注册 $cmsname !",lang('尊敬的').$username.', '.lang('您好!欢迎你注册'.$cmsname.'!'));
}
front::flash(lang('注册成功!'));
}else {
front::flash(lang('注册失败!'));
return;
}
if(union::getconfig('enabled')) {
$union_visitid = intval(cookie::get('union_visitid'));
$union_userid = intval(cookie::get('union_userid'));
if($union_visitid &&$union_userid) {
$union_reg = new union();
$r = $union_reg->getrow(array('userid'=>$union_userid));
if($r) {
$union_reg->rec_update(array('registers'=>'[registers+1]'),array('userid'=>$union_userid));
if($union_reg->affected_rows()) {
$union_visit_reg = new union_visit();
$union_visit_reg->rec_update(array('regusername'=>front::post('username'),'regtime'=>time()),array('visitid'=>$union_visitid));
$this->_user->rec_update(array('introducer'=>$union_userid),array('userid'=>$_userid));
$regrewardtype = union::getconfig('regrewardtype');
$regrewardnumber = union::getconfig('regrewardnumber');
switch($regrewardtype) {
case 'point':
union::pointadd($r['username'],$regrewardnumber,'union');
break;
}
}
}
}
}
$user=$data;
cookie::set('login_username',$user['username']);
cookie::set('login_password',front::cookie_encode($user['password']));
session::set('username',$user['username']);
front::redirect(url::create('user'));
exit;
}
else {
front::flash(lang('注册失败!'));
return;
}
}
}
示例9: url
static function url($id) {
return url::create('announ/show/id/'.$id);
}
示例10: while
$dir2=opendir($path);
while ($file=readdir($dir2)) {
$files++;
}
$koption='<option value="">选择关键词...</option>';
while ($file=readdir($dir)) {
if ($file != '..' && $file != '.' && !is_dir($path.'/'.$file) || $files == 0) {
if ($files == 0)
$keyword=null;
else
$keyword=urldecode(substr($file, 0, -4));
if ($_keyword) {
if ($_keyword != $keyword) {
$path1=ROOT.'/data/hotsearch/'.urlencode($_keyword).'.txt';
file_put_contents($path1, $_keywordcount);
front::redirect(url::create('index/hotsearch/post/1'));
}
}
$keywordcount = @file_get_contents($path.'/'.$file);
echo '<a href="'.config::get('site_url').'?case=archive&act=search&keyword='.str_replace('%', '-', urlencode($keyword)).'&ule=1" target="_blank"><span>'.$keyword.'</span> ('.$keywordcount.') </a>';
$koption .= '<option value="'.$file.'">'.$keyword.'</option>';
}
}
}
?>
</div>
<div class="blank10"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="table1">
<tr>
示例11: register_action
function register_action() {
$r = $this->_union->getrow(array('userid'=>$this->view->data['userid']));
if($r) {
echo '<script type="text/javascript">alert("'.lang('你已经申请,转入联盟页面!').'")</script>';
front::refresh(url::create('union/stats'));
}
if(front::post('submit')) {
if(!config::get('reg_on')) {
front::flash(lang('网站已经关闭注册!'));
return;
}
if(config::get('verifycode')) {
if(!session::get('verify') ||front::post('verify')<>session::get('verify')) {
front::flash(lang('验证码错误!'));
return;
}
}
if(front::post('nickname') != strip_tags(front::post('nickname'))
||front::post('nickname') != htmlspecialchars(front::post('nickname'))
) {
front::flash(lang('姓名不规范!'));
return;
}
if(strlen(front::post('nickname'))<4) {
front::flash(lang('请填写认真填写真实姓名!'));
return;
}
if(strlen(front::post('payaccount'))<1) {
front::flash(lang('请填写支付账号!'));
return;
}
if(strlen(front::post('tel'))<1) {
front::flash(lang('请填写联系电话!'));
return;
}
if(strlen(front::post('address'))<1) {
front::flash(lang('请填写联系地址!'));
return;
}
if(strlen(front::post('website'))<1) {
front::flash(lang('请填写网站地址!'));
return;
}
/*if(strlen(front::post('e_mail'))<1) {
front::flash(lang('请填写邮箱!'));
return;
}*/
if(is_array($_POST)){
foreach ($_POST as $v){
if(preg_match('/(select|load_file|\[|password)/i', $v)){
exit('not access');
}
}
}
$userarr = array();
$userarr['nickname'] = front::$post['nickname'];
$userarr['tel'] = front::$post['tel'];
$userarr['address'] = front::$post['address'];
//$userarr['e_mail'] = front::$post['e_mail'];
$unionarr = array();
$unionarr['userid'] = $this->view->data['userid'];
$unionarr['username'] = $this->view->data['username'];
$unionarr['payaccount'] = front::$post['payaccount'];
$unionarr['website'] = front::$post['website'];
$unionarr['profitmargin'] = union::getconfig('profitmargin');
$unionarr['regtime'] = time();
$unionarr['regip'] = front::ip();
$unionarr['passed'] = 1;
if(front::post('nickname') &&$this->view->data['userid']) {
$insert=$this->_user->rec_update($userarr,'userid='.$this->view->user['userid']);
$insert1 = $this->_union->rec_insert($unionarr);
if($insert &&$insert1) front::flash(lang('申请成功!'));
else {
front::flash(lang('申请失败!'));
return;
}
front::redirect(url::create('union/stats'));
exit;
}
else {
front::flash(lang('申请失败!'));
return;
}
}
}
示例12: index_action
function index_action() {
$this->list_action();
if(front::post('submit')) {
if(!front::post('guesttel')) {
front::flash(lang('请填写联系电话!'));
return false;
}
if(!front::post('title')) {
front::flash(lang('请填写标题!'));
return false;
}
if(!front::post('content')) {
front::flash(lang('请选择内容!'));
return false;
}
if(config::get('verifycode')) {
if(front::post('verify')<>session::get('verify')) {
front::flash(lang('验证码错误!'));
return false;
}
}
front::$post['checked']=0;
if(empty($this->view->user)) {
front::$post['userid']=0;
front::$post['username']='游客:'.front::$post['nickname'];
}else {
front::$post['userid']=$this->view->user['userid'];
front::$post['username']=$this->view->user['username'];
}
front::$post['adddate']=date('Y-m-d H:i:s');
front::$post['ip']=front::ip();
if (!get_magic_quotes_gpc()) {
front::$post['content'] = front::$post['content'];
}
front::$post['title']=strip_tags(front::$post['title']);
$data=front::$post;
$insert=$this->_table->rec_insert($data);
if($insert<1) {
front::flash(lang('留言失败!'));
}
else {
if(config::get('email_gust_send_cust') && front::$post['guestemail']){
$title = "您在".config::get('sitename')."的留言已提交";
$this->sendmail(front::$post['guestemail'], $title, $title);
}
if(config::get('email_guest_send_admin') && config::get('email')){
$title = '网站在' . date('Y-m-d H:i:s') . '有新留言了';
$this->sendmail(config::get('email'), $title, $title);
}
if(config::get('sms_on') && config::get('sms_guestbook_on')){
sendMsg(front::$post['guesttel'],config::get('sms_guestbook'));
}
if(config::get('sms_on') && config::get('sms_guestbook_admin_on') && $mobile = config::get('site_mobile')){
sendMsg($mobile,front::$post['username'].'在'.date('Y-m-d H:i:s').'留言了');
}
front::flash(lang('留言成功!'));
$this->view->submit_success=true;
if(front::get('t') == 'wap'){
front::redirect(url::create('guestbook/index/t/wap/success/'.time()));
}else{
front::redirect(url::create('guestbook/index/success/'.time()));
}
}
}
}
示例13: get
<div class="quick">
<a href="<?php
echo $base_url;
?>
/" target="_blank">网站首页</a>
<a href="<?php
echo url::create('index/index/mod/cache');
?>
">生成静态</a>
<a href="index.php?case=table&act=add&table=archive&admin_dir=<?php
echo get('admin_dir');
?>
">添加内容</a>
<a href="<?php
echo url::create('config/remove');
?>
" class="on">更新缓存</a>
</div>
</div>
<div class="right">
<div id="right_box">
<script type="text/javascript">
<!--
function table(o,a,b,c,d){
if(!document.getElementById(o)){ return; }
var t=document.getElementById(o).getElementsByTagName("tr");
for(var i=0;i<t.length;i++){
t[i].style.backgroundColor=(t[i].sectionRowIndex%2==0)?a:b;
t[i].onclick=function(){
示例14: down_action
function down_action() {
if(config::get('verifycode')) {
if(cookie::get('allowdown')!=md5(url::create('attachment/downfile/aid/'.front::get('aid').'/v/ce'))) {
header("Location: index.php?case=attachment&act=downfile&aid=".front::get('aid')."&v=ce");
}
}
front::check_type(front::get('aid'));
if(!rank::arcget(front::get('aid'),$this->view->usergroupid,'down')) {
$link="<script>alert(\"未取得授权,无法下载!\");</script>";
exit($link);
}
if(strtolower(substr(archive_attachment(front::get('aid'),'path'),0,4)) == 'http'){
echo "<script>window.location.href='".archive_attachment(front::get('aid'),'path')."';</script>";
exit;
}
$path=ROOT.'/'.archive_attachment(front::get('aid'),'path');
$path=iconv('utf-8','gbk//ignore',$path);
if (!is_readable($path)) {
header("HTTP/1.1 404 Not Found");
exit;
}
$size=filesize($path);
$content=file_get_contents($path);
$size=strlen($content);
$name=preg_replace('%(.*)[\\\\\/](.*)_\d+(\.[a-z]+)$%i','$2$3',$path);
$name=substr($name,-7,7);
$name='CmsEasy_file_'.$name;
header('Content-Type: application/octet-stream');
header("Content-Length: $size");
header("Content-Disposition: attachment; filename=\"$name\"");
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
echo $content;
exit;
}
示例15: orders_action
function orders_action() {
$this->view->aid = trim(front::get('aid'));
if (front::post('submit')) {
$this->orders = new orders();
$row = $this->orders->getrow("","adddate DESC");
//var_dump(time());
if($row['adddate'] && time() - $row['adddate'] <= intval(config::get('order_time'))){
alerterror('操作频繁,请稍后再试');
return;
}
if (front::$post['telphone'] == '') {
alerterror('联系电话为必填!');
return;
}
front::$post['mid'] = $this->view->user['userid'] ? $this->view->user['userid'] : 0;
front::$post['adddate'] = time();
front::$post['ip'] = front::ip();
if (isset(front::$post['aid'])) {
$aidarr = front::$post['aid'];
unset(front::$post['aid']);
foreach ($aidarr as $val) {
front::$post['aid'].=$val . ',';
front::$post['pnums'].=front::$post['thisnum'][$val] . ',';
}
} else {
front::$post['aid'] = $this->view->aid;
}
if (!isset(front::$post['logisticsid']))
front::$post['logisticsid'] = 0;
front::$post['oid'] = date('YmdHis') . '-' . front::$post['logisticsid'] . '-' . front::$post['mid'] . '-' . front::$post['payname'];
$insert = $this->orders->rec_insert(front::$post);
if ($insert < 1) {
front::flash($this->tname . lang('添加失败!'));
} else {
if (config::get('sms_on') && config::get('sms_order_on')) {
sendMsg(front::$post['telphone'], config::get('sms_order'));
}
if (config::get('sms_on') && config::get('sms_order_admin_on') && $mobile = config::get('site_mobile')) {
sendMsg($mobile, '网站在' . date('Y-m-d H:i:s') . '有新订单了');
//echo 11;
}
$user = $this->view->user;
if(config::get('email_order_send_cust') && $user['e_mail']){
$title = "您在".config::get('sitename')."的订单".front::get('oid')."已提交";
$this->sendmail($user['e_mail'], $title, $title);
}
if(config::get('email_order_send_admin') && config::get('email')){
$title = '网站在' . date('Y-m-d H:i:s') . '有新订单了';
$this->sendmail(config::get('email'), $title, $title);
}
if (front::$post['payname'] && front::$post['payname'] != 'nopay') {
echo '<script type="text/javascript">alert("' . lang('orderssuccess') . ' ' . lang('现在转入支付页面') . '");window.location.href="' . url('archive/payorders/oid/' . front::$post['oid'], true) . '";</script>';
}
echo '<script type="text/javascript">alert("' . lang('orderssuccess') . '");window.location.href="' . url('archive/orders/oid/' . front::$post['oid'], true) . '";</script>';
}
} elseif (front::get('oid')) {
preg_match_all("/-(.*)-(.*)-(.*)/isu", front::get('oid'), $oidout);
$this->view->paytype = $oidout[3][0];
if($oidout[2][0] != $this->view->user['userid']){
alertinfo('查看订单失败', url::create('index/index'));
}
$where = array();
$where['oid'] = front::get('oid');
$this->view->orders = orders::getInstance()->getrow($where);
$this->view->statusnum = $data['status'] = $this->view->orders['status'];
switch ($data['status']) {
case 1:
$data['status'] = lang('完成');
break;
case 2:
$data['status'] = lang('处理中');
break;
case 3:
$data['status'] = lang('已发货');
break;
case 4:
$data['status'] = lang('客户已付款,待审核');
break;
case 5:
$data['status'] = lang('已核实客户支付');
break;
default:
$data['status'] = lang('新订单');
break;
}
$this->view->orders['status'] = $data['status'];
if ($this->view->paytype) {
$this->view->gotopaygateway = '<a href="' . url('archive/payorders/oid/' . front::get('oid'), true) . '">进入支付页面</a>';
}
//var_dump($this->view->user);var_dump($_SESSION);exit();
$this->out('message/orderssuccess.html');
} elseif (front::get('aid')) {
$this->view->archive = archive::getInstance()->getrow(front::get('aid'));
$this->view->categorys = category::getpositionlink2($this->view->archive['catid']);
$this->view->paylist = pay::getInstance()->getrows('', 50);
$this->view->logisticslist = logistics::getInstance()->getrows('', 50);
$prices = getPrices($this->view->archive['attr2']);
//.........这里部分代码省略.........