本篇文章给大家带来的内容是关于如何使用php实现openSug.js的参数调试(代码示例),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。
这是一款利PHP对百度搜索下拉框提示免费代码实现参数配置调试的程序源代码.
由想要对网站进行搜索下拉调试的站长朋友们进行方便、快速的效果演示,具体参考下面的PHP代码.
如何使用?
免费 盛世企业网站管理系统(SnSee)系统完全免费使用,无任何功能模块使用限制,在使用过程中如遇到相关问题可以去官方论坛参与讨论。开源 系统Web代码完全开源,在您使用过程中可以根据自已实际情况加以调整或修改,完全可以满足您的需求。强大且灵活 独创的多语言功能,可以直接在后台自由设定语言版本,其语言版本不限数量,可根据自已需要进行任意设置;系统各模块可在后台自由设置及开启;强大且适用的后台管理支
立即学习“PHP免费学习笔记(深入)”;
请新建一份PHP文档,并将下面PHP代码粘贴进去,然后通过浏览器访问访该文档即可进行预览openSug各种效果
'QQ群',
'friend' => '分流节点',
'api' => 'API进阶',
);
session_start();
$n = empty($_GET["n"]) ? NULL : $_GET["n"];
$f = empty($_POST["friend"]) ? NULL : $_POST["friend"];
$q = empty($_POST["qun"]) ? NULL : $_POST["qun"];
$l = empty($_POST["link"]) ? NULL : $_POST["link"];
date_default_timezone_set("PRC");
header("Refresh: 3600");
header("Content-Type:text/html;charset=utf-8");
header("Cache-Control: max-age=". 9E9);
header("Expires: ". gmdate ("l, d F Y H:i:s",strtotime("+9 year"))." GMT");
define("Q", "./qun.list");
define("F", "./friend.list");
define("D", "./js/opensug.js");
define("WP_USE_THEMES", false);
define("G", "aHR0cHM6Ly9vcGVuc3VnLmdpdGh1Yi5pby9qcy9vcGVuc3VnLmpz");
define("I", substr($_SERVER["PHP_SELF"],strrpos($_SERVER["PHP_SELF"], "/")+1));
define("H", dirname(((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"]=="on") || (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && $_SERVER["HTTP_X_FORWARDED_PROTO"] == "https")) ? "https://". $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"] : "http://". $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]));
define("S", $_SERVER["SERVER_NAME"]);
define("client", '_'. md5($_SERVER['REMOTE_ADDR']) .'_');
//empty($_SERVER['HTTP_VIA']) or exit('Access Denied!');
if(isset($_SESSION[client])){
list($s1, $s2) = explode(' ', microtime());
if( (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000) - $_SESSION[client] < 2000){
header("Refresh:5");
header("HTTP/1.1 403 Forbidden");
exit('[403]刷新过于频繁, 请稍后重试!
');
}
$_SESSION[client] = (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000);
}else{
list($s1, $s2) = explode(' ', microtime());
$_SESSION[client] = (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000);
}
if($n == 'js') _down(D);elseif($n == 'php')_down(I);
if(!empty($_GET['dl'])) _down('./user/'. $_GET['dl']);
// update openSug.js
if($n == S) exit(G);
if(!file_exists(D)){/* || (time()-filemtime(D)) > 604800*/
!is_dir("./js/")&&mkdir("./js/", 0755, true);
$res = _curl(base64_decode(G));
if(strlen($res) > 10){
if(!file_put_contents(D, $res )) exit("Error: execution failed.");
}else(exit("Update failed!"));
header("Refresh: 3");
exit("Updating openSug.js file, please wait...");
}
if(!empty($f)){
$url = parse_url($f) ? parse_url($f) : NULL;
if(!empty($url["host"])){
$auth = _curl($url["scheme"] ."://". $url["host"] . (!empty($url["path"]) ? $url["path"] : NULL) ."?n=". $url["host"]);
if($auth == G){
if(!file_put_contents(F, $url["scheme"]."://".$url["host"].$url["path"]."|" )) exit("Error: execution failed.");
$Msg = "Subnode sharing is complete, thank you for your support!";
header("Refresh: 0");
}else($Msg ="Error:The submission failed and the site you submitted is not an openSug subnode.");
}
}
if(!empty($q)){
if(preg_match("/^\d*$/",$q) && strlen($q) > 4){
if(!empty($l) && strlen($l) == 64 && preg_match('/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9a-zA-Z]+$/', $l) == 1) $links = $l;
else $qunt = 'Illegal IdKey!';
if(!file_put_contents(Q, intval($q).','. (empty($links) ? NULL : $links) .'|', FILE_APPEND)) $qunt = 'Failed!';
$qunt = 'Success.';
}else $qunt='Illegal group number!';
}
if((!empty($_POST['user']))){
!is_dir("./user/")&&mkdir("./user/", 0755, true);
if(!file_exists(D))exit($Msg = "The openSug.js file is missing.");
$userJS = time() .'.js';
if(!file_put_contents('./user/'. $userJS, ( get('sugResult',"") ? 'var _source;_source="'. get('sugResult',"") .'";':NULL) . file_get_contents(D) . "\r\n". $_POST['conf'] ."\r\n//{{".date('H:i:s m/d Y').'}}'.(!empty($_SERVER["HTTP_CLIENT_IP"]) ? $_SERVER["HTTP_CLIENT_IP"] : !empty($_SERVER["HTTP_X_FORWARDED_FOR"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"]:!empty($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:NULL)."{".$_SERVER['HTTP_USER_AGENT'].'}' )) exit("Error: execution failed.");
}
function get($i="",$o=""){return empty($_GET[$i]) ? $o : $_GET[$i];}
function _down($d){
if(!file_exists($d)){header("HTTP/1.0 404 Not Found");return"";}
header("Content-type: application/javascript");
header("Content-Disposition: attachment; filename=\"". basename($d) ."\"");
exit(file_get_contents($d));
}
function _curl($url = ""){
if(function_exists("curl_init") && strlen($url) > 6){
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_TIMEOUT,5);
curl_setopt($c, CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($c, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$res = curl_exec($c);
$sta = curl_getinfo($c)["http_code"];
curl_close($c);
if($sta == '200') return $res;
return false;
}else(exit("Error:the current environment does not support cURL."));
}?>
百度搜索下拉框提示免费代码 - openSug.js .bind" />
百度搜索下拉框提示免费代码_openSug.js
只需引用一段JS即可获得带有“搜索框提示”功能的搜索框,让您的搜索更便捷! @@##@@
节点:
openSug分流节点
'. $url['host'] .' ';
}
}?>
baiduSug = "1"
选中词条时默认执行表单提交动作
zuojiankuohaophpcnform action="https://www.baidu.com/baidu" target="_blank"youjiankuohaophpcn
zuojiankuohaophpcninput type="text" baiduSug="1" name="word" size="30" /youjiankuohaophpcn
zuojiankuohaophpcninput type="submit" value="百度搜索" /youjiankuohaophpcn
zuojiankuohaophpcn/formyoujiankuohaophpcn
baiduSug = "2"
" />
选中词条时不执行表单提交动作
zuojiankuohaophpcnform action="https://www.baidu.com/baidu" target="_blank"youjiankuohaophpcn
zuojiankuohaophpcninput type="text" baiduSug="2" name="word" size="30" /youjiankuohaophpcn
zuojiankuohaophpcninput type="submit" value="百度搜索" /youjiankuohaophpcn
zuojiankuohaophpcn/formyoujiankuohaophpcn
更新日志';
if(file_exists('./faq/wp-load.php')){
// 加载wp-load.php占用内存超过32倍.
require('./faq/wp-load.php');
query_posts('showposts=5&orderby=new');
while(have_posts()) : the_post();?>
" href="">
';
?>
* 浏览器支持:IE6+, Firefox, Chrome, Safari, Opera, Edge...
* 在网页中引入Javascript文件,Javascript代码请尽量添加到网页中 zuojiankuohaophpcn/body> 闭合标签之前.
* 如使用utf-8编码,请务必在script标签中设置 charset="gbk" 属性,否则搜索提示词会出现乱码.已修正!后面','zuojiankuohaophpcnscript type="text/javascript" src="https://opensug.github.io/js/opensug.js">');">zuojiankuohaophpcnscript type="text/javascript" src="https://cdn.jsdelivr.net/g/opensug/">zuojiankuohaophpcn/script>
为受窘的人说一句解围的话;为沮丧的人说一句鼓励的话;为疑惑的人说一句提醒的话;为自卑的人说一句自信的话;为痛苦的人说一句安慰的话...因为,更多时候,我们需要的是雪中送炭,而不是锦上添花.
DNS: charles.ns.cloudflare.com、janet.ns.cloudflare.com
1000 ? round($mem / 1024, 2) .'MB': $mem .'KB';}$endtime = explode(' ',microtime());$thistime=$endtime[0]+$endtime[1]-($starttime[0]+$starttime[1]);echo " ". round($thistime,2) ."second.";?>
var _source;_source="'. get('sugResult',"") .'";';?>
相关文章
php远程访问文件怎么打开_php远程音频文件读取播放法【媒体】
PHP 中高效监听标准输入按键的正确实现方法
php怎样去除数组重复值_php去除数组重复值函数【去重】
Phpstorm怎么调整PHP代码折叠_Phpstorm调整PHP代码折叠法【参考】
PHP怎样添加空间索引_PHP空间索引建表法【地理】
相关标签:
本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门AI工具
更多










