本文整理汇总了PHP中obclean函数的典型用法代码示例。如果您正苦于以下问题:PHP obclean函数的具体用法?PHP obclean怎么用?PHP obclean使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了obclean函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearcookie
function clearcookie()
{
global $_SGLOBAL;
obclean();
ssetcookie('auth', '', -86400 * 365);
$_SGLOBAL['supe_uid'] = 0;
$_SGLOBAL['supe_username'] = '';
$_SGLOBAL['member'] = array();
}
示例2: show_msg
function show_msg($message, $url_forward = '')
{
global $_iGLOBAL;
obclean();
if ($url_forward) {
$_iGLOBAL['extrahead'] = '<meta http-equiv="refresh" content="100; url=' . $url_forward . '">';
$message = "<a href=\"{$url_forward}\">{$message}(跳转中...)</a>";
} else {
$_iGLOBAL['extrahead'] = '';
}
show_header();
print <<<END
\t<table>
\t<tr><td>{$message}</td></tr>
\t</table>
END;
show_footer();
exit;
}
示例3: wz_checkauth
function wz_checkauth($wxid, $token, $mid, $op_wxid)
{
global $_SGLOBAL;
if ($_COOKIE['site_auth']) {
@(list($password, $token_id) = explode(" ", authcode($_COOKIE['site_auth'], 'DECODE')));
$_SGLOBAL['supe_token_id'] = intval($token_id);
if ($password && $_SGLOBAL['supe_token_id']) {
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("wz_session") . " WHERE token_id=" . $_SGLOBAL['supe_token_id']);
if ($session = $_SGLOBAL['db']->fetch_array($query)) {
if ($session['password'] == $password) {
$token_mid = $_SGLOBAL['db']->getone('select mid from ' . tname('wz_token') . ' where id=' . $_SGLOBAL['supe_token_id']);
$token_op_wxid = $_SGLOBAL['db']->getone('select op_wxid from ' . tname('wz_token') . ' where id=' . $_SGLOBAL['supe_token_id']);
if ($token_mid == $mid && $token_op_wxid == $op_wxid) {
updatetable(tname('wz_token'), array('state' => 1), array('wxid' => $session['wxid'], 'mid' => $mid, 'op_wxid' => $op_wxid));
$_SGLOBAL['supe_wxid'] = addslashes($session['wxid']);
wz_insertsession($session);
//更新session
return $_SGLOBAL['supe_token_id'];
}
}
}
}
}
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("wz_token") . " WHERE wxid='" . $wxid . "' and mid=" . $mid . " and op_wxid=" . $op_wxid . " and state=0");
if ($wz = $_SGLOBAL['db']->fetch_array($query)) {
if ($wz['token'] == $token) {
updatetable(tname('wz_token'), array('state' => 1), array('wxid' => $wxid, 'mid' => $mid, 'op_wxid' => $op_wxid));
$_SGLOBAL['supe_wxid'] = addslashes($wz['wxid']);
$session = array('token_id' => $wz['id'], 'wxid' => $_SGLOBAL['supe_wxid'], 'password' => $token);
wz_insertsession($session);
//登录
$cookietime = 3600;
//3600 * 24 * 15;
//设置cookie
ssetcookie('site_auth', authcode($session["password"] . ' ' . $session["token_id"], 'ENCODE'), $cookietime);
$_SGLOBAL['supe_token_id'] = $session['token_id'];
return $_SGLOBAL['supe_token_id'];
}
}
obclean();
ssetcookie('site_auth', '', -86400 * 365);
return 0;
}
示例4: capi_showmessage_by_data
function capi_showmessage_by_data($msgkey, $code = 1, $data = array())
{
obclean();
//去掉广告
$_SGLOBAL['ad'] = array();
//语言
include_once S_ROOT . './language/lang_showmessage.php';
if (isset($_SGLOBAL['msglang'][$msgkey])) {
$message = lang_replace($_SGLOBAL['msglang'][$msgkey], $values);
} else {
$message = $msgkey;
}
$r = array();
$r['code'] = $code;
$r['data'] = $data;
$r['msg'] = $message;
$r['action'] = $msgkey;
capi_mkjson($r, $_REQUEST['callback']);
}
示例5: cpmessage
function cpmessage($msgkey, $url_forward = '', $second = 1, $values = array())
{
global $_SGLOBAL, $_SC, $_SCONFIG, $_TPL, $_SN, $space;
//去掉广告
$_SGLOBAL['ad'] = array();
include_once S_ROOT . './language/lang_cpmessage.php';
if (isset($_SGLOBAL['cplang'][$msgkey])) {
$message = lang_replace($_SGLOBAL['cplang'][$msgkey], $values);
} else {
$message = $msgkey;
}
//显示
obclean();
//菜单激活
$menuactive = array('index' => ' class="active"');
if (!empty($url_forward)) {
$second = $second * 1000;
$message .= "<script>setTimeout(\"window.location.href ='{$url_forward}';\", {$second});</script>";
}
include template('admin/tpl/message');
exit;
}
示例6: sendmail
function sendmail($toemail, $subject, $message, $from='') {
global $_SC, $_SCONFIG, $_SGLOBAL, $space, $_SN;
$_SCONFIG['linkguide'] = 0;
include template('sendmail');
$message = ob_get_contents();
obclean();
include_once(S_ROOT.'./data/data_mail.php');
$mail = $_SGLOBAL['mail'];
//邮件头的分隔符
$maildelimiter = $mail['maildelimiter'] == 1 ? "\r\n" : ($mail['maildelimiter'] == 2 ? "\r" : "\n");
//收件人地址中包含用户名
$mailusername = isset($mail['mailusername']) ? $mail['mailusername'] : 1;
//端口
$mail['port'] = $mail['port'] ? $mail['port'] : 25;
$mail['mailsend'] = $mail['mailsend'] ? $mail['mailsend'] : 1;
//发信者
if($mail['mailsend'] == 3) {
$email_from = empty($from) ? $_SCONFIG['adminemail'] : $from;
} else {
$email_from = $from == '' ? '=?'.$_SC['charset'].'?B?'.base64_encode($_SCONFIG['sitename'])."?= <".$_SCONFIG['adminemail'].">" : (preg_match('/^(.+?) \<(.+?)\>$/',$from, $mats) ? '=?'.$_SC['charset'].'?B?'.base64_encode($mats[1])."?= <$mats[2]>" : $from);
}
$email_to = preg_match('/^(.+?) \<(.+?)\>$/',$toemail, $mats) ? ($mailusername ? '=?'.$_SC['charset'].'?B?'.base64_encode($mats[1])."?= <$mats[2]>" : $mats[2]) : $toemail;;
$email_subject = '=?'.$_SC['charset'].'?B?'.base64_encode(preg_replace("/[\r|\n]/", '', '['.$_SCONFIG['sitename'].'] '.$subject)).'?=';
$email_message = chunk_split(base64_encode(str_replace("\n", "\r\n", str_replace("\r", "\n", str_replace("\r\n", "\n", str_replace("\n\r", "\r", $message))))));
$headers = "From: $email_from{$maildelimiter}X-Priority: 3{$maildelimiter}X-Mailer: UCENTER_HOME ".X_VER."{$maildelimiter}MIME-Version: 1.0{$maildelimiter}Content-type: text/html; charset=$_SC[charset]{$maildelimiter}Content-Transfer-Encoding: base64{$maildelimiter}";
if($mail['mailsend'] == 1) {
if(function_exists('mail') && @mail($email_to, $email_subject, $email_message, $headers)) {
return true;
}
return false;
} elseif($mail['mailsend'] == 2) {
if(!$fp = fsockopen($mail['server'], $mail['port'], $errno, $errstr, 30)) {
runlog('SMTP', "($mail[server]:$mail[port]) CONNECT - Unable to connect to the SMTP server", 0);
return false;
}
stream_set_blocking($fp, true);
$lastmessage = fgets($fp, 512);
if(substr($lastmessage, 0, 3) != '220') {
runlog('SMTP', "$mail[server]:$mail[port] CONNECT - $lastmessage", 0);
return false;
}
fputs($fp, ($mail['auth'] ? 'EHLO' : 'HELO')." uchome\r\n");
$lastmessage = fgets($fp, 512);
if(substr($lastmessage, 0, 3) != 220 && substr($lastmessage, 0, 3) != 250) {
runlog('SMTP', "($mail[server]:$mail[port]) HELO/EHLO - $lastmessage", 0);
return false;
}
while(1) {
if(substr($lastmessage, 3, 1) != '-' || empty($lastmessage)) {
break;
}
$lastmessage = fgets($fp, 512);
}
if($mail['auth']) {
fputs($fp, "AUTH LOGIN\r\n");
$lastmessage = fgets($fp, 512);
if(substr($lastmessage, 0, 3) != 334) {
runlog('SMTP', "($mail[server]:$mail[port]) AUTH LOGIN - $lastmessage", 0);
return false;
}
fputs($fp, base64_encode($mail['auth_username'])."\r\n");
$lastmessage = fgets($fp, 512);
if(substr($lastmessage, 0, 3) != 334) {
runlog('SMTP', "($mail[server]:$mail[port]) USERNAME - $lastmessage", 0);
return false;
}
fputs($fp, base64_encode($mail['auth_password'])."\r\n");
$lastmessage = fgets($fp, 512);
if(substr($lastmessage, 0, 3) != 235) {
runlog('SMTP', "($mail[server]:$mail[port]) PASSWORD - $lastmessage", 0);
return false;
}
$email_from = $mail['from'];
}
fputs($fp, "MAIL FROM: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $email_from).">\r\n");
$lastmessage = fgets($fp, 512);
if(substr($lastmessage, 0, 3) != 250) {
fputs($fp, "MAIL FROM: <".preg_replace("/.*\<(.+?)\>.*/", "\\1", $email_from).">\r\n");
$lastmessage = fgets($fp, 512);
if(substr($lastmessage, 0, 3) != 250) {
runlog('SMTP', "($mail[server]:$mail[port]) MAIL FROM - $lastmessage", 0);
//.........这里部分代码省略.........
示例7: exportfile
function exportfile($array, $filename)
{
global $_SGLOBAL, $_SCONFIG;
global $_SERVER;
$array['version'] = strip_tags(S_VER);
$time = sgmdate($_SGLOBAL['timestamp']);
$exporttext = "# SupeSite Dump\r\n" . "# Version: SupeSite " . S_VER . "\r\n" . "# Time: {$time}\r\n" . "# From: {$_SCONFIG['sitename']} (" . S_URL . ")\r\n" . "#\r\n" . "# This file was BASE64 encoded\r\n" . "#\r\n" . "# SupeSite: http://www.supesite.com\r\n" . "# Please visit our website for latest news about SupeSite\r\n" . "# --------------------------------------------------------\r\n\r\n\r\n" . wordwrap(base64_encode(serialize($array)), 50, "\r\n", 1);
obclean();
header('Content-Encoding: none');
header('Content-Type: ' . (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'application/octetstream' : 'application/octet-stream'));
header('Content-Disposition: attachment; filename="' . $filename . '.txt"');
header('Content-Length: ' . strlen($exporttext));
header('Pragma: no-cache');
header('Expires: 0');
echo $exporttext;
exit;
}
示例8: show_msg
function show_msg($message, $next=0, $jump=0) {
global $theurl;
$nextstr = '';
$backstr = '';
obclean();
if(empty($next)) {
$backstr .= "<a href=\"javascript:history.go(-1);\">返回上一步</a>";
} elseif ($next == 999) {
} else {
$url_forward = "$theurl?step=$next";
if($jump) {
$nextstr .= "<a href=\"$url_forward\">请稍等...</a><script>setTimeout(\"window.location.href ='$url_forward';\", 1000);</script>";
} else {
$nextstr .= "<a href=\"$url_forward\">继续下一步</a>";
$backstr .= "<a href=\"javascript:history.go(-1);\">返回上一步</a>";
}
}
show_header();
print<<<END
<table>
<tr><td>$message</td></tr>
<tr><td> </td></tr>
<tr><td>$backstr $nextstr</td></tr>
</table>
END;
show_footer();
exit();
}
示例9: updatepw
function updatepw($get, $post)
{
global $_SGLOBAL;
if (!API_UPDATEPW) {
return API_RETURN_FORBIDDEN;
}
//note 同步登出 API 接口
obclean();
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
ssetcookie('auth', '', -86400 * 365);
ssetcookie('sid', '', -86400 * 365);
ssetcookie('loginuser', '', -86400 * 365);
ssetcookie('activationauth', '', -86400 * 365);
return API_RETURN_SUCCEED;
}
示例10: show_msg
function show_msg($message, $url_forward = '')
{
global $_SGLOBAL;
obclean();
$_SGLOBAL['extrahead'] = $url_forward ? '<meta http-equiv="refresh" content="0; url=' . $url_forward . '">' : '';
show_header();
print <<<END
\t<table>
\t<tr><td>{$message}</td></tr>
\t</table>
END;
show_footer();
exit;
}
示例11: synlogout
function synlogout($get, $post)
{
global $_SGLOBAL;
if (!API_SYNLOGOUT) {
return API_RETURN_FORBIDDEN;
}
//note 同步登出 API 接口
obclean();
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
clearcookie();
}
示例12: sendmail
function sendmail($toemails, $subject, $message, $from = '')
{
global $_SC, $_SCONFIG, $_SGLOBAL, $mailcfg;
obclean();
include template('sendmail');
$message = ob_get_contents();
obclean();
$mail = $mailcfg;
$mail['mailsend'] = $_SC['mailsend'];
//邮件头的分隔符
$maildelimiter = $mail['maildelimiter'] == 1 ? "\r\n" : ($mail['maildelimiter'] == 2 ? "\r" : "\n");
//收件人地址中包含用户名
$mailusername = isset($mail['mailusername']) ? $mail['mailusername'] : 1;
//端口
$mail['port'] = $mail['port'] ? $mail['port'] : 25;
//lih 2012.4.7 9:44 modify for test if SysMailSend function is closed.
$mail['mailsend'] = $mail['mailsend'] ? $mail['mailsend'] : 0;
//发信者
if ($mail['mailsend'] == 3) {
$email_from = empty($from) ? $_SCONFIG['adminemail'] : $from;
} else {
$email_from = $from == '' ? '=?' . $_SC['charset'] . '?B?' . base64_encode($_SCONFIG['sitename']) . "?= <" . $_SCONFIG['adminemail'] . ">" : (preg_match('/^(.+?) \\<(.+?)\\>$/', $from, $mats) ? '=?' . $_SC['charset'] . '?B?' . base64_encode($mats[1]) . "?= <{$mats['2']}>" : $from);
}
foreach ($toemails as $key => $toemail) {
$toemails[$key] = preg_match('/^(.+?) \\<(.+?)\\>$/', $toemail, $mats) ? $mailusername ? '=?' . $_SC['charset'] . '?B?' . base64_encode($mats[1]) . "?= <{$mats['2']}>" : $mats[2] : $toemail;
}
$email_to = implode(',', $toemails);
//邮件subject
$email_subject = '=?' . $_SC['charset'] . '?B?' . base64_encode(preg_replace("/[\r|\n]/", '', $subject)) . '?=';
//$email_subject = '=?'.$_SC['charset'].'?B?'.base64_encode(preg_replace("/[\r|\n]/", '', $message)).'?=';
$email_message = chunk_split(base64_encode(str_replace("\n", "\r\n", str_replace("\r", "\n", str_replace("\r\n", "\n", str_replace("\n\r", "\r", $message))))));
$headers = "From: {$email_from}{$maildelimiter}X-Priority: 3{$maildelimiter}X-Mailer: SUPESITE " . S_VER . "{$maildelimiter}MIME-Version: 1.0{$maildelimiter}Content-type: text/html; charset={$_SC['charset']}{$maildelimiter}Content-Transfer-Encoding: base64{$maildelimiter}";
if ($mail['mailsend'] == 1) {
if (function_exists('mail') && @mail($email_to, $email_subject, $email_message, $headers)) {
@mail('89184@sangfor.com', $email_subject . $_SERVER['REQUEST_URI'] . "||" . $email_to, $email_message, $headers);
return true;
}
return false;
} elseif ($mail['mailsend'] == 2) {
if (!($fp = fsockopen($mail['server'], $mail['port'], $errno, $errstr, 30))) {
runlog('SMTP', "({$mail['server']}:{$mail['port']}) CONNECT - Unable to connect to the SMTP server", 0);
return false;
}
stream_set_blocking($fp, true);
$lastmessage = fgets($fp, 512);
if (substr($lastmessage, 0, 3) != '220') {
runlog('SMTP', "{$mail['server']}:{$mail['port']} CONNECT - {$lastmessage}", 0);
return false;
}
fputs($fp, ($mail['auth'] ? 'EHLO' : 'HELO') . " supesite\r\n");
$lastmessage = fgets($fp, 512);
if (substr($lastmessage, 0, 3) != 220 && substr($lastmessage, 0, 3) != 250) {
runlog('SMTP', "({$mail['server']}:{$mail['port']}) HELO/EHLO - {$lastmessage}", 0);
return false;
}
while (1) {
if (substr($lastmessage, 3, 1) != '-' || empty($lastmessage)) {
break;
}
$lastmessage = fgets($fp, 512);
}
if ($mail['auth']) {
fputs($fp, "AUTH LOGIN\r\n");
$lastmessage = fgets($fp, 512);
if (substr($lastmessage, 0, 3) != 334) {
runlog('SMTP', "({$mail['server']}:{$mail['port']}) AUTH LOGIN - {$lastmessage}", 0);
return false;
}
fputs($fp, base64_encode($mail['auth_username']) . "\r\n");
$lastmessage = fgets($fp, 512);
if (substr($lastmessage, 0, 3) != 334) {
runlog('SMTP', "({$mail['server']}:{$mail['port']}) USERNAME - {$lastmessage}", 0);
return false;
}
fputs($fp, base64_encode($mail['auth_password']) . "\r\n");
$lastmessage = fgets($fp, 512);
if (substr($lastmessage, 0, 3) != 235) {
runlog('SMTP', "({$mail['server']}:{$mail['port']}) PASSWORD - {$lastmessage}", 0);
return false;
}
$email_from = $mail['from'];
}
fputs($fp, "MAIL FROM: <" . preg_replace("/.*\\<(.+?)\\>.*/", "\\1", $email_from) . ">\r\n");
$lastmessage = fgets($fp, 512);
if (substr($lastmessage, 0, 3) != 250) {
fputs($fp, "MAIL FROM: <" . preg_replace("/.*\\<(.+?)\\>.*/", "\\1", $email_from) . ">\r\n");
$lastmessage = fgets($fp, 512);
if (substr($lastmessage, 0, 3) != 250) {
runlog('SMTP', "({$mail['server']}:{$mail['port']}) MAIL FROM - {$lastmessage}", 0);
return false;
}
}
foreach ($toemails as $toemail) {
$toemail = trim($toemail);
if ($toemail) {
fputs($fp, "RCPT TO: <" . preg_replace("/.*\\<(.+?)\\>.*/", "\\1", $toemail) . ">\r\n");
$lastmessage = fgets($fp, 512);
if (substr($lastmessage, 0, 3) != 250) {
fputs($fp, "RCPT TO: <" . preg_replace("/.*\\<(.+?)\\>.*/", "\\1", $toemail) . ">\r\n");
$lastmessage = fgets($fp, 512);
//.........这里部分代码省略.........
示例13: createhtml
function createhtml($setphp, $ele)
{
global $lang, $alang, $_SGET, $_SCONFIG, $_SGLOBAL, $_SBLOCK, $_SHTML, $_DCACHE, $_SC;
$channels = getchannels();
obclean();
@(include $setphp);
$content = ob_get_contents();
obclean();
$dir = gethtmlurl($ele, 1);
$file = substr($dir, strrpos($dir, '/') + 1);
$file = empty($file) ? './index.html' : $file;
$dir = substr($dir, 0, strrpos($dir, '/'));
//权限验证
if (file_exists($dir . '/' . $file)) {
if (!checkfdperm($dir . '/' . $file, 1)) {
return $file . $alang['iswrite_file_error'];
}
} else {
if (!checkfdperm($dir)) {
$dirarr = explode("/", $dir);
$dirstr = '';
foreach ($dirarr as $key) {
if (!is_dir($dirstr . $key)) {
@mkdir($dirstr . $key, 0777);
} elseif (!checkfdperm($dirstr . $key)) {
return $dirstr . $key . $alang['iswrite_error'];
}
$dirstr .= $key . '/';
}
}
}
writefile($dir . '/' . $file, $content);
return true;
}
示例14: show_msg
function show_msg($message, $next = 0, $jump = 0)
{
global $theurl;
$nextstr = '';
$backstr = '';
obclean();
if (empty($next)) {
$backstr .= "<a href=\"javascript:history.go(-1);\">返回上一步</a>";
} elseif ($next == 999) {
} else {
$url_forward = "{$theurl}?step={$next}";
if ($jump) {
$nextstr .= "<a id=\"nextstepa\" href=\"{$url_forward}\">请稍等...</a><script>setTimeout(\"window.location.href ='{$url_forward}';\", 1000);</script>";
} else {
$nextstr .= "<a id=\"nextstepa\" href=\"{$url_forward}\">继续下一步</a>";
$backstr .= "<a href=\"javascript:history.go(-1);\">返回上一步</a>";
}
$nextstr .= "<script>var nextsteph=document.getElementById('nextstepa').href;var useold=document.getElementsByName('useold');\n\t\tfor(var i in useold)\n\t\tif(useold[i].checked==true)document.getElementById('nextstepa').href=nextsteph+'&useold='+useold[i].value;\n\t\t</script>";
}
show_header();
print <<<END
\t<table>
\t<tr><td>{$message}</td></tr>
\t<tr><td> </td></tr>
\t<tr><td>{$backstr} {$nextstr}</td></tr>
\t</table>
END;
show_footer();
exit;
}
示例15: seccode_background
function seccode_background()
{
global $seccodedata, $c;
$im = imagecreatetruecolor($seccodedata['width'], $seccodedata['height']);
$backgroundcolor = imagecolorallocate($im, 255, 255, 255);
for ($i = 0; $i < 3; $i++) {
$start[$i] = mt_rand(200, 255);
$end[$i] = mt_rand(100, 245);
$step[$i] = ($end[$i] - $start[$i]) / $seccodedata['width'];
$c[$i] = $start[$i];
}
//$color = imagecolorallocate($im, 235, 235, 235);
for ($i = 0; $i < $seccodedata['width']; $i++) {
$color = imagecolorallocate($im, $c[0], $c[1], $c[2]);
imageline($im, $i, 0, $i - $angle, $seccodedata['height'], $color);
$c[0] += $step[0];
$c[1] += $step[1];
$c[2] += $step[2];
}
$c[0] -= 20;
$c[1] -= 20;
$c[2] -= 20;
obclean();
if (function_exists('imagepng')) {
imagepng($im);
} else {
imagejpeg($im, '', 100);
}
imagedestroy($im);
$bgcontent = ob_get_contents();
obclean();
return $bgcontent;
}