本文整理汇总了PHP中decode函数的典型用法代码示例。如果您正苦于以下问题:PHP decode函数的具体用法?PHP decode怎么用?PHP decode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了decode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteAction
function deleteAction()
{
if (POST) {
$this->scrap->Delete(decode($_REQUEST['id']));
}
die;
}
示例2: plugin_ajaxrss_action
function plugin_ajaxrss_action()
{
global $get;
if ($get['t'] == 'js') {
$output = plugin_ajaxrss_output_js();
// Feeding start
pkwk_common_headers();
// header('Content-type: text/javascript');
print $output;
} else {
if ($get['t'] == 'url') {
$output = plugin_ajaxrss_output_url(decode($get['q']));
// Feeding start
pkwk_common_headers();
header('Content-type: application/xml');
if (!preg_match('/\\<\\?xml/', $output, $matches)) {
print '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
}
print $output;
} else {
$output = plugin_ajaxrss_output_xml();
// Feeding start
pkwk_common_headers();
header('Content-type: application/xml');
if (!preg_match('/\\<\\?xml/', $output, $matches)) {
print '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
}
print $output;
}
}
exit;
}
示例3: index
function index()
{
if ($this->session->userdata('is_admin_login') == TRUE) {
redirect('register_form');
}
if ($this->input->cookie('username') != '' && $this->input->cookie('password') != '') {
$username = decode($this->input->cookie('username'), 'key123');
$getdata = $this->admin_model->info(array('username' => $username));
if ($getdata->num_rows() > 0) {
$admin = $getdata->row();
if ($admin->password == $this->input->cookie('password')) {
$session = array('role' => $admin->role, 'administrator_id' => $admin->administrator_id, 'email' => $admin->email, 'username' => $admin->username, 'is_admin_login' => true);
$this->session->set_userdata($session);
$log = array();
$log['administrator_id'] = $this->session->userdata('administrator_id');
$log['username'] = $this->session->userdata('username');
$log['label'] = 'login';
$log['detail'] = 'Login';
$this->admin_log_model->create($log);
redirect('register_form');
}
}
}
$data['title'] = $this->config->item('title');
$this->load->view('index', $data);
}
示例4: updatestatusAction
function updatestatusAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(TRUE);
$formvalues = $this->_getAllParams();
debugMessage($formvalues);
$session = SessionWrapper::getInstance();
$this->_translate = Zend_Registry::get("translate");
$formvalues['id'] = $id = $formvalues['id'];
$formvalues['dateapproved'] = date("Y-m-d H:i:s", strtotime('now'));
$formvalues['approvedbyid'] = $session->getVar('userid');
// debugMessage($formvalues);
$leave = new Leave();
$leave->populate($id);
$leave->setStatus($formvalues['status']);
$leave->setDateApproved(DEFAULT_DATETIME);
$leave->setApprovedByID($session->getVar('userid'));
if (!isArrayKeyAnEmptyString('reason', $formvalues)) {
$leave->setReason("<br/>Rejected with remarks: " . $formvalues['reason']);
}
try {
$leave->save();
$leave->afterApprove($formvalues['status']);
$session->setVar(SUCCESS_MESSAGE, $this->_translate->translate($formvalues[SUCCESS_MESSAGE]));
} catch (Exception $e) {
// debugMessage('error '.$e->getMessage());
$session->setVar(ERROR_MESSAGE, $e->getMessage());
}
// exit();
$this->_helper->redirector->gotoUrl(decode($formvalues[URL_SUCCESS]));
}
示例5: indexAction
function indexAction()
{
if ($this->getRequest()->getParam('ref')) {
$user = new UsersModel();
$this->view->InvitedUser = $user->InvitedContact(decode($this->getRequest()->getParam('ref')));
if ($this->session->user["id"] > 0) {
$this->_redirect("bio/" . encode($this->view->InvitedUser["uid"]) . "#slams/post");
}
$user = new UsersModel($this->view->InvitedUser["uid"]);
$this->view->InviteeUser = $user->Info();
}
if ($this->getRequest()->getParam('userid')) {
if ($this->session->user["id"] > 0) {
$this->_redirect("bio/" . $this->getRequest()->getParam('userid'));
}
$user = new UsersModel(decode($this->getRequest()->getParam("userid")));
$iV = $this->view->InviteeUser = $user->Info();
$this->view->error = array("<strong>Login</strong> to view " . ($iV['gender'] == 'M' ? 'his' : 'her') . " <strong>tweets</strong>, <strong>slambook</strong> and other <strong>exciting</strong> stuffs.<br />New users can <strong>signup</strong> with a <strong>single step »</strong>", 60, "welcome");
}
if ($this->session->user["id"] > 0) {
$this->_redirect("my");
}
$user = new UsersModel();
$this->view->users = $user->Search(array(), array(0, 12), NULL, array("gender DESC"));
}
示例6: links
function links($cat = 0, $direction = "asc")
{
global $linksmessage, $prefix;
if ($direction != "asc" && $direction != "desc") {
$direction = "asc";
}
$out = "";
if ($cat) {
$query = "SELECT * FROM " . $prefix . "linkscat WHERE id=" . $cat . " ORDER BY nome";
} else {
$query = "SELECT * FROM " . $prefix . "linkscat ORDER BY nome";
}
if (!($cresult = dbquery($query))) {
die($linksmessage[4]);
}
$out .= "\n<div id=\"LNE_show\">\n";
while ($crow = fetch_array($cresult)) {
$out .= "<h3>" . decode($crow['descr']) . "</h3>\n";
$query = "SELECT * FROM " . $prefix . "links where hits=" . $crow[0] . " ORDER BY name " . $direction;
if (!($result = dbquery($query))) {
die($linksmessage[5]);
}
if (num_rows($result)) {
$out .= "<ul>\n";
while ($row = fetch_array($result)) {
$out .= "<li><a href=\"" . $row['link'] . "\" onclick=\"window.open(this.href,'_blank');return false;\">" . decode($row['name']) . "</a><div>" . decode($row['descr']) . "</div></li>\n";
}
$out .= "</ul>\n";
}
}
$out .= "</div>\n";
return $out;
}
示例7: excelAction
function excelAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(TRUE);
$session = SessionWrapper::getInstance();
$formvalues = $this->_getAllParams();
// debugMessage($formvalues);
$title = $this->_getParam('reporttitle');
// debugMessage($formvalues);
$cvsdata = decode($formvalues['csv_text']);
if (!isEmptyString($title)) {
$cvsdata = str_replace('"--"', '""', $cvsdata);
$title = str_replace(', ', ' ', $title);
$cvsdata = $title . "\r\n" . $cvsdata;
}
// debugMessage($cvsdata); exit();
$currenttime = time();
$filename = $currenttime . '.csv';
/*$full_path = BASE_PATH.DIRECTORY_SEPARATOR."temp".DIRECTORY_SEPARATOR.$filename;
file_put_contents($full_path, $cvsdata);*/
$data = stripcslashes($cvsdata);
// debugMessage($data);
// exit();
//OUPUT HEADERS
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"{$filename}\";");
header("Content-Transfer-Encoding: binary");
//OUTPUT CSV CONTENT
echo $data;
exit;
}
示例8: __construct
public function __construct($file)
{
$myfile = fopen($file, "r") or die("Unable to open file!");
$data = json_decode(decode(fread($myfile, filesize($file))));
fclose($myfile);
$this->data = $data;
}
示例9: active_email
public function active_email()
{
if (!isset($GLOBALS['auth']) || !isset($GLOBALS['uid']) || !isset($GLOBALS['email']) || !isset($GLOBALS['t'])) {
MSG('验证失败!');
}
$auth = $GLOBALS['auth'];
$uid = intval($GLOBALS['uid']);
$email = $GLOBALS['email'];
$t = $GLOBALS['t'];
if (decode($auth) != $t . $uid . $email) {
MSG('验证失败!');
}
if ($t < SYS_TIME - 3600) {
MSG('邮件验证超时,请重新验证!', 'index.php?m=member&f=index&v=edit_email');
}
$this->db->update('member', array('ischeck_email' => 1), array('uid' => $uid));
$point_config = get_cache('point_config');
$credit_api = load_class('credit_api', 'credit');
$keyid = 'em' . $uid;
//验证邮箱,只送一次
if (!$credit_api->get($keyid)) {
$credit_api->handle($uid, '+', $point_config['email_check'], '验证邮箱:' . $email, '', $keyid);
}
MSG('邮件验证成功!', 'index.php?m=member&f=index&v=account_safe');
}
示例10: check_access
function check_access()
{
$CI =& get_instance();
$CI->load->library('user_agent');
$CI->load->library('session');
try {
$data = $CI->db->limit("1")->where('id', decode($CI->session->userdata('_i')))->get('user');
if ($data->num_rows() > 0) {
$data = $data->result_array();
$sess = $CI->session->userdata();
$group = $CI->db->where('id', $sess['group'])->limit(1)->get('user_group');
if ($group->num_rows() > 0) {
$group = $group->result_array();
if ($CI->agent->browser() == $data[0]['browser'] && $_SERVER['REMOTE_ADDR'] == $data[0]['ip']) {
return true;
} else {
$time = $sess['__ci_last_regenerate'] - strtotime(date("Y-m-d H:i:s"));
if ($time > 7200) {
$CI->session->sess_destroy();
show_error($e->getMessage(), "500", $header = "Auth Page Failed");
}
return false;
}
} else {
return false;
}
} else {
return false;
}
} catch (Exception $e) {
show_error($e->getMessage(), "404", $header = "Error 500");
}
}
示例11: edit
public function edit()
{
$this->load->helper('url');
$this->load->library('menuroleaccess');
$auth_page = $this->menuroleaccess->check_access("pegawai");
if ($auth_page) {
$this->load->model('pegawai_model');
/** Success Login **/
$data['sForm'] = "Edit Pegawai";
$data['title'] = "HRM: Edit Pegawai";
$data['nik'] = intval(decode($this->uri->segment(3)));
$data['agama'] = $this->pegawai_model->get_agama();
$data['pendidikan'] = $this->pegawai_model->get_pendidikan_pegawai();
$data['kota'] = $this->pegawai_model->get_kota();
$data['provinsi'] = $this->pegawai_model->get_provinsi();
$data['status_pegawai'] = $this->pegawai_model->get_status_pegawai();
$data['golongan'] = $this->pegawai_model->get_golongan();
$data['status_keluarga'] = $this->pegawai_model->get_keluarga_pegawai();
$data['lokasi'] = $this->pegawai_model->get_lokasi_peg();
render('pegawai_act', $data, "pegawai");
} else {
$this->load->library('sess');
$this->sess->session_destroy();
redirect(config_item('base_url'));
}
}
示例12: __scrm_plugin_environment
function __scrm_plugin_environment()
{
$funcdir = __DIR__ . "/funcs/";
if (!is_file($funcdir . 'sys.php')) {
return false;
}
require_once "{$funcdir}sys.php";
if (get_site_option("{$GLOBALS['plgn_shortname']}_version") < $GLOBALS["{$GLOBALS['plgn_shortname']}_version"]) {
__scrm_plugin_install();
}
// print "{$funcdir}sys.php";
$tmp = scandir($funcdir);
foreach ($tmp as $v) {
if (!strpos($v, '.php')) {
continue;
}
require_once "{$funcdir}{$v}";
}
$GLOBALS['act'] = $act = __action_maker();
$GLOBALS['p'] = $p = __action_maker('p');
$GLOBALS['fl'] = $fl = __action_maker('fl');
//print_rr(__chek_w3i_form());
if (chek_val($p, '1')) {
setcookie($p[1], decode($_GET), time() + 86400 * 15, '/');
}
// Registrieren der WordPress-Hooks
add_action('admin_menu', "__{$GLOBALS['plgn_shortname']}_plugin_admin_menu");
add_action('init', 'loadScrummerPostTypes', 0);
//////// plugin public actions
if (!is_admin()) {
__scrmActions();
add_action("template_redirect", 'my_theme_redirect');
}
return;
}
示例13: formCheckbox
function formCheckbox($attributes = false)
{
if (isset($attributes) and is_array($attributes)) {
$attrs = null;
foreach ($attributes as $attribute => $value) {
if ($attribute !== "position" and $attribute !== "text" and $attribute !== "type" and $attribute !== "checked") {
$attrs .= ' ' . strtolower($attribute) . '="' . encode($value) . '"';
} else {
${$attribute} = encode($value);
}
}
$check = (isset($checked) and $checked) ? ' checked="checked"' : null;
if (isset($position) and $position === "left" and isset($text)) {
return '' . decode($text) . ' <input' . $attrs . ' type="checkbox"' . $check . ' /> ';
} elseif (isset($position) and $position === "right" and isset($text)) {
return '<input' . $attrs . ' type="checkbox"' . $check . ' /> ' . decode($text) . ' ';
} elseif (isset($text)) {
return '' . decode($text) . ' <input' . $attrs . ' type="checkbox"' . $check . ' /> ';
} else {
return '<input' . $attrs . ' type="checkbox"' . $check . ' /> ';
}
} else {
return null;
}
}
示例14: decodeall
function decodeall($licenseKey)
{
global $arr_key;
$arr_return = array();
$search_start = -1 * (MAX_KEY_LENGTH + 300);
$licenseKey = trim($licenseKey);
$sub_value = substr($licenseKey, $search_start, MAX_KEY_LENGTH);
$sub_value = decode($sub_value, 0, 120);
$start = 0;
for ($i = 0; $i < MAX_PARAMETER_LENGTH; $i++) {
$var_beg = substr($sub_value, $start, 6);
$start += 6;
$var_wc = substr($sub_value, $start, 6);
$start += 6;
$var_sep = substr($sub_value, $start, 6);
$start += 6;
$var_off = substr($sub_value, $start, 6);
$start += 6;
$var_wc = $var_wc * $var_sep;
$var_string = substr($licenseKey, (int) $var_beg, $var_wc);
$var_string = decode($var_string, (int) $var_sep, (int) $var_off);
$arr_return[$i] = $var_string;
}
return $arr_return;
}
示例15: decode_ht
function decode_ht($path) {
$da_path = './' . $path;
if (!@file_exists($da_path) || !$a = @file($da_path)) exit;
return explode(',', decode($a[0]));
}