찾다
백엔드 개발PHP 튜토리얼PHP를 사용하여 openSug.js의 매개변수 디버깅을 구현하는 방법(코드 예)

本篇文章给大家带来的内容是关于如何使用php实现openSug.js的参数调试(代码示例),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。

这是一款利PHP对百度搜索下拉框提示免费代码实现参数配置调试的程序源代码.

由想要对网站进行搜索下拉调试的站长朋友们进行方便、快速的效果演示,具体参考下面的PHP代码.

如何使用?

请新建一份PHP文档,并将下面PHP代码粘贴进去,然后通过浏览器访问访该文档即可进行预览openSug各种效果

<?php
$starttime = explode(&#39; &#39;,microtime());
$title = array(
    &#39;qun&#39; => &#39;QQ群&#39;,
    &#39;friend&#39; => &#39;分流节点&#39;,
    &#39;api&#39; => &#39;API进阶&#39;,
);

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", &#39;_&#39;. md5($_SERVER[&#39;REMOTE_ADDR&#39;]) .&#39;_&#39;);
//empty($_SERVER[&#39;HTTP_VIA&#39;]) or exit(&#39;Access Denied!&#39;);
if(isset($_SESSION[client])){
    list($s1, $s2) = explode(&#39; &#39;, microtime());
    if( (float)sprintf(&#39;%.0f&#39;, (floatval($s1) + floatval($s2)) * 1000) - $_SESSION[client] < 2000){
        header("Refresh:5");
        header("HTTP/1.1 403 Forbidden");
        exit(&#39;<p style="margin:0px;text-align:center;background-color:#FDFFCE;font-size:12px;padding:5px 30px;border:1px #FFBA43 solid;font-weight:700;color:#FF0000;">[403]刷新过于频繁, 请稍后重试!</p>&#39;);
    }
    $_SESSION[client] = (float)sprintf(&#39;%.0f&#39;, (floatval($s1) + floatval($s2)) * 1000);
}else{
    list($s1, $s2) = explode(&#39; &#39;, microtime());
    $_SESSION[client] = (float)sprintf(&#39;%.0f&#39;, (floatval($s1) + floatval($s2)) * 1000);
}

if($n == &#39;js&#39;) _down(D);elseif($n == &#39;php&#39;)_down(I);
if(!empty($_GET[&#39;dl&#39;])) _down(&#39;./user/&#39;. $_GET[&#39;dl&#39;]);

// 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(&#39;/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9a-zA-Z]+$/&#39;, $l) == 1) $links = $l;
        else $qunt = &#39;<span style="color:red;">Illegal IdKey!</span>&#39;;
        if(!file_put_contents(Q, intval($q).&#39;,&#39;. (empty($links) ? NULL : $links) .&#39;|&#39;, FILE_APPEND)) $qunt = &#39;<span style="color:red">Failed!</span>&#39;;
        $qunt = &#39;<span style="color:green">Success.</span>&#39;;
    }else $qunt=&#39;<span style="color:red;">Illegal group number!</span>&#39;;
}

if((!empty($_POST[&#39;user&#39;]))){
    !is_dir("./user/")&&mkdir("./user/", 0755, true);
    if(!file_exists(D))exit($Msg = "The openSug.js file is missing.");
    $userJS = time() .&#39;.js&#39;;
    if(!file_put_contents(&#39;./user/&#39;. $userJS, ( get(&#39;sugResult&#39;,"") ? &#39;var _source;_source="&#39;. get(&#39;sugResult&#39;,"") .&#39;";&#39;:NULL) . file_get_contents(D) . "\r\n". $_POST[&#39;conf&#39;] ."\r\n//{{".date(&#39;H:i:s m/d Y&#39;).&#39;}}&#39;.(!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[&#39;HTTP_USER_AGENT&#39;].&#39;}&#39; )) 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[&#39;HTTP_USER_AGENT&#39;]);
        $res = curl_exec($c);
        $sta = curl_getinfo($c)["http_code"];
        curl_close($c);
        if($sta == &#39;200&#39;) return $res;
        return false;
    }else(exit("Error:the current environment does not support cURL."));
}?>
<!DOCTYPE html><html><head><meta charset="UTF-8"><title><?php echo empty($n) ? &#39;&#39; : $title[$n] .&#39;[&#39;. (empty($_GET["sugResult"]) ? &#39;BaiduSuggestion&#39; : $_GET["sugResult"]) .&#39;.bind()] - &#39;;?>百度搜索下拉框提示免费代码 - openSug.js</title><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"><link rel="dns-prefetch" href="//img.shields.io"/><link rel="dns-prefetch" href="//data.jsdelivr.com"/><link rel="dns-prefetch" href="//www.bountysource.com"/><link rel="dns-prefetch" href="//travis-ci.org"/><link rel="dns-prefetch" href="//ghbtns.com"/><link rel="dns-prefetch" href="//cloudflare.com"/><link rel="dns-prefetch" href="//api.travis-ci.org"/><link rel="dns-prefetch" href="//api.github.com"/><link rel="dns-prefetch" href="//www.opensug.eu.org"/><link rel="dns-prefetch" href="//hm.baidu.com"/><link rel="dns-prefetch" href="//cdn.jsdelivr.net"/><link rel="dns-prefetch" href="//www.baidu.com"/><link rel="dns-prefetch" href="//opensug.github.io"/><style type="text/css">html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-size:62.5%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;padding:3px;outline:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;margin-left:-6px}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input[type=text]{width:61%}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-scrollbar-track-piece{background-color:#f8f8f8;}::-webkit-scrollbar{width:9px;height:9px;}::-webkit-scrollbar-thumb{background-color:#dddddd;background-clip:padding-box;min-height:28px;}::-webkit-scrollbar-thumb:hover{background-color:#bbb;}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.list:after,.list:before,.item:after,.item:before{content:"";display:table}.list:after,.item:after{clear:both;overflow:hidden}.c-list-title,.item-1st,.item-2nd,.item-3rd{float:left}body{color:#333;font-size:16px;font-family:Verdana,Helvetica,"LiHei Pro","Microsoft JhengHei",sans-serif;line-height:1.6;background:#fff}a{color:#008b8b;text-decoration:none}a:hover{text-decoration:underline}.container,.detail{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 auto;max-width:1080px;padding-left:10px;padding-right:10px}.header{background:#eee;margin-bottom:30px;width:100%;line-height:50px;height:50px}.header h1{margin:0 auto;text-align:center;line-height:2em;font-size:1.5em}.header h1 a{color:#008b8b}.header h1 a:focus,.header h1 a:hover{text-decoration:none}.Examples{height:130px;margin-bottom:1em;padding-top:2em}.DEMO{float:right;margin:20px 0 0 0;max-width:230px;-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-ms-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.DEMO1{position:relative}.DEMO1:focus{color:red}.DEMO2{display:-webkit-box;-webkit-box-ordinal-group:1;-webkit-order:1;order:1;-webkit-box-flex:0;flex:0 0 auto;margin:-5px 0 margin-left:5px}.DEMO3{padding-left:0;padding-right:8px;font-size:18px;border-left:none;color:#000;line-height:25px;background-color:transparent;border:none;margin:0;padding:0}.DEMO3.DEMO0{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;display:-webkit-box;-webkit-box-ordinal-group:2;-webkit-order:2;order:2;-webkit-box-flex:1;-webkit-flex:1 0;flex:1 0;padding-left:8px}.DEMO4{font-size:18px}.DEMO4:focus{outline:0}.DEMO5{font-family:"Microsoft YaHei"!important;cursor:pointer;-webkit-border-radius:0;color:#FFF;padding:0;position:absolute;right:0;top:0;background-color:#3385ff;box-sizing:border-box;-webkit-border-top-right-radius:2px;background:-webkit-gradient(linear,left top,left bottom,from(#3385ff),to(#cae6ff))!important;border:1px solid #2d78f4;height:37px;width:50px;-webkit-border-bottom-right-radius:2px}#config input[type=text],input[type=color],input[type=number],select{width:60%}.footer{background-color:#fff;text-align:center;color:#999;font-size:.6em;position:fixed;bottom:0;width:100%;padding:10px 0}.list{background:#fff;margin-bottom:30px;width:100%}.item{-moz-transition-property:background;-o-transition-property:background;-webkit-transition-property:background;transition-property:background;-moz-transition-duration:.3s;-o-transition-duration:.3s;-webkit-transition-duration:.3s;transition-duration:.3s}.item:focus,.item:hover{background:#eff7f7}.item.title{background:#eee;border-bottom:1px solid #e3e3e3}.item.title:focus,.item.title:hover{background:#e1e1e1}.c-list-title{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding:5px 20px;float:none;}form{margin:30px auto}.c-list-title a{-moz-transition-property:color;-o-transition-property:color;-webkit-transition-property:color;transition-property:color;-moz-transition-duration:.3s;-o-transition-duration:.3s;-webkit-transition-duration:.3s;transition-duration:.3s}.c-list-title{max-width:100%}.c-list-title a{color:#008b8b}.c-list-title a:focus,.c-list-title a:hover{color:#005858}.detail{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #e3e3e3;padding-bottom:20px;margin-bottom:80px}.article-title{border-bottom:1px solid #e3e3e3;color:#44321b;padding-bottom:.83em}.article-box img{display:block;max-width:100%;margin-top:10px;margin-bottom:10px}.item-1st,.item-2nd,.item-3rd{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;margin-right:20px}.item-1st{width:32%;width:calc(35% - 20px)}.item-2nd{width:32%;width:calc(35% - 20px)}.item-3rd{width:30%;margin-right:0}@media (max-width:768px){.item-1st{width:45%;width:calc(50% - 10px);margin-right:10px}.item-2nd{width:45%;width:calc(50% - 10px);margin-left:10px;margin-right:0}.item-3rd{width:100%;margin-left:0;margin-right:0;margin-top:20px}}@media (max-width:480px){.item-1st,.item-2nd,.item-3rd{width:100%;margin-left:0;margin-right:0}.item-2nd,.item-3rd{margin-top:20px}}.code{padding:5px;border:1px solid #e1e1e1;background-color:#f0f0f0;border-left:10px solid #e0e0e0;}.src{word-wrap:break-word;text-align:left;padding:10px 5px;margin-bottom:1em;border-left:3px solid #e1e1e1;background:#eee;border-bottom:1px solid #e3e3e3;}</div></style><link rel="canonical" href="https://www.opensug.org/" /><meta content="always" name="referrer"><meta name="theme-color" content="#191919"><link rel="shortcut icon" href="https://www.baidu.com/favicon.ico" type="image/x-icon" /><link rel="icon" sizes="any" mask href="https://www.baidu.com/img/baidu.svg" /><meta name="description" content="百度搜索框提示免费代码(openSug.js):只需引用一段JS即可获得带有“搜索框提示”功能的搜索框,让您的搜索更便捷!" /><meta name="keywords" content="opensug,openSug.js,百度搜索框提示免费代码,搜索下拉框,jQuery,<?php echo(empty($_GET["sugResult"]) ? &#39;BaiduSuggestion&#39; : $_GET["sugResult"]);?>.bind" /></head><body>
<header role="banner" style="padding:2.5% 4.5455%;background-color:#191919;margin-bottom:1em;">
    <div style="-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;margin:0 auto;max-width:1060px;color:#FFFFFF;">
        <h1 style="-webkit-margin-after:0;"><a href="<?php echo I;?>" rel="home" style="color:#d7d7d7;text-decoration:none;" title="百度搜索下拉框提示免费代码_openSug.js">百度搜索下拉框提示免费代码_openSug.js</a></h1>
        <p style="color:#686868;-webkit-margin-before:0;vertical-align:middle;">只需引用一段JS即可获得带有“搜索框提示”功能的搜索框,让您的搜索更便捷! <img src="/static/imghwm/default1.png"  data-src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat"  class="lazy"   alt="license:MIT"   style="max-width:90%" /></p>
    </div>
</header>
    <!--div class="header" title="百度搜索下拉框提示免费代码 - openSug.js"><a href="<?php echo I;?>" style="text-decoration:none;"><h1 id="openSug-js">openSug.js</h1></a></div-->
    <div class="container">
        <div style="text-align:left;padding:10px 5px;margin-top:.2em;margin-bottom:.7em;background-color:#eeeeee;border-left:3px solid #999999;color:#008b8b;border-bottom:1px solid #e3e3e3">下载: <a href="?n=js" style="color:red" title="下载openSug.js代码">JS</a> <a href="?n=php" style="color:blue" title="下载本页面源码" onClick="alert(&#39;请下载后上传到你的主机空间[限PHP]&#39;);">PHP</a> <a target="_blank" href="https://www.npmjs.com/package/opensug">NPMJS</a>       <span style="float:right"><a href="?n=qun" style="color:#F60">Q群</a> <a href="?n=friend" style="color:green">分流</a></span></div>
        <?php if($n==&#39;api&#39;){?>
        <div class="list" style="margin-bottom:0;">
            <div class="item title"><div class="c-list-title">API进阶</div></div>
            <div class="row" style="padding:5rem"><form style="background:none;width:80%" action="https://www.baidu.com/s" method="GET" target="_blank" onSubmit="return wd.value!=""" role="search"><input type="hidden" name="si" value="<?php echo S;?>" /><input name="ct" type="hidden" value="2097152" /><div class="DEMO1"><div class="msfo"><div style="background-color:#fff !important;border-color:#cae6ff;border-style:solid;border-width:2px 1px 2px 2px;border-right:none;margin-top:-1px;padding:0;padding-right:0;height:35px;padding-right:0;border:1px solid #E3E3E3 !important;border-right:none !important;border-top:1px solid #E3E3E3 !important;zoom:1;position:relative"><div style="display:-webkit-box;display:-webkit-flex;display:flex;padding:5px 0;"><input type="text" class="DEMO3 DEMO0 DEMO4" id="inputObj" maxlength="2048" name="wd" autocapitalize="off" autocomplete="off" autocorrect="off" autofocus="autofocus" placeholder="本输入框ID为:inputObj"></div></div></div><button type="submit" class="DEMO5"><div class="sbico">搜索</div></button></div></form></div>
            <a href="https://www.opensug.org/faq/uncaught-typeerror-cannot-read-property-guid-of-null/" target="_blank"><p style="text-align:left;color:red;padding:.3em;background-color:#FFC">关于出现Uncaught TypeError: Cannot read property &#39;_GUID&#39; of null的解决方案,请点击此处...</p></a>
            <form action="" method="get" style="margin:0;"><input type="hidden" name="n" value="api">
            <table width="100%" border="0" cellspacing="5" cellpadding="0" id="config">
            <tr>
                <td class="i"><label for="id">输入框ID</label></td>
                <td><input type="text" id="id" name="id" value="<?php echo get(&#39;id&#39;, &#39;inputObj&#39;);?>" onFocus="select();" /></td>
                <td class="i" for="act"><label for="sugSubmit">动作</label></td>
                <td><select id="sugSubmit" name="sugSubmit"><option value="true"<?php if(get(&#39;sugSubmit&#39;, &#39;-1&#39;)!=&#39;false&#39;)echo &#39; selected="selected"&#39;;?> >选中提交</option><option value="false"<?php if(get(&#39;sugSubmit&#39;, &#39;-1&#39;)==&#39;false&#39;)echo &#39; selected="selected"&#39;;?> >手动提交</option></select></td>
            </tr>
            <tr>
                <td class="i"><label for="XOffset">横向偏移</label></td>
                <td title="提示框位置横向偏移量,负值向右偏移,单位px"><input type="number" id="XOffset" name="XOffset" value="<?php echo get(&#39;XOffset&#39;, &#39;-15&#39;);?>" /></td>
                <td class="i"><label for="YOffset">纵向偏移</label></td>
                <td title="提示框位置纵向偏移量,负值向下偏移,单位px"><input type="number" id="YOffset" name="YOffset" value="<?php echo get(&#39;YOffset&#39;, &#39;-30&#39;);?>" /></td>
            </tr>
            <tr>
                <td class="i"><label for="width">宽度</label></td>
                <td><input type="number" id="width" name="width" onFocus="select();" value="<?php echo get(&#39;width&#39;, "");?>" /></td>
                <td class="i"><label for="borderColor">边框颜色</label></td>
                <td><input type="color" id="borderColor" name="borderColor" value="<?php echo get(&#39;borderColor&#39;, &#39;#008000&#39;);?>" /></td>
            </tr>
            <tr>
                <td class="i"><label for="fontFamily">字体</label></td>
                <td><input type="text" id="fontFamily" name="fontFamily" onFocus="select();" value="<?php echo get(&#39;fontFamily&#39;, &#39;Microsoft YaHei&#39;);?>" /></td>
                <td class="i"><label for="fontColor">提示框文字颜色</label></td>
                <td><input type="color" id="fontColor" name="fontColor" value="<?php echo get(&#39;fontColor&#39;, &#39;#FF0000&#39;);?>" /></td>
            </tr>
            <tr>
                <td class="i"><label for="fontSize">字体大小</label></td>
                <td><input type="text" id="fontSize" name="fontSize" onFocus="select();" value="<?php echo get(&#39;fontSize&#39;, &#39;28px&#39;);?>" /></td>
                <td class="i"><label for="bgcolorHI">背景高亮颜色</label></td>
                <td><input type="color" id="bgcolorHI" name="bgcolorHI" value="<?php echo get(&#39;bgcolorHI&#39;, &#39;#FF6600&#39;);?>" /></td>
            </tr>
            <tr>
                <td class="i"><label for="confirmCallback">回调函数</label></td>
                <td><input type="text" id="confirmCallback" name="confirmCallback" onFocus="select();" value="<?php echo get(&#39;confirmCallback&#39;, &#39;function(Callback){}&#39;);?>" /></td>
                <td class="i"><label for="fontColorHI">字体高亮颜色</label></td>
                <td><input type="color" id="fontColorHI" name="fontColorHI" value="<?php echo get(&#39;fontColorHI&#39;, &#39;#FFFFFF&#39;);?>" /></td>
            </tr>
            <tr>
                <td colspan="4" style="text-align:center;padding-top:10px;">
                <select id="sugResult" name="sugResult" style="width:120px;color:blue;"><option value=""<?php if(get(&#39;sugResult&#39;, &#39;-1&#39;)=="")echo &#39; selected="selected"&#39;;?> >百度[缺省]</option><option value="google"<?php if(get(&#39;sugResult&#39;, "")==&#39;google&#39;)echo &#39; selected="selected"&#39;;?> >Google</option><option value="haoso"<?php if(get(&#39;sugResult&#39;, "")==&#39;haoso&#39;)echo &#39; selected="selected"&#39;;?> >奇虎好搜</option><option value="kugou"<?php if(get(&#39;sugResult&#39;, "")==&#39;kugou&#39;)echo &#39; selected="selected"&#39;;?> >酷狗[音乐]</option><option value="yahoo"<?php if(get(&#39;sugResult&#39;, "")==&#39;yahoo&#39;)echo &#39; selected="selected"&#39;;?> >雅虎</option><option value="yandex"<?php if(get(&#39;sugResult&#39;, "")==&#39;yandex&#39;)echo &#39; selected="selected"&#39;;?> >Yandex</option><option value="youku"<?php if(get(&#39;sugResult&#39;, "")==&#39;youku&#39;)echo &#39; selected="selected"&#39;;?> >优酷[视频]</option><option value="taobao"<?php if(get(&#39;sugResult&#39;, "")==&#39;taobao&#39;)echo &#39; selected="selected"&#39;;?> >淘宝[购物]</option></select>    <input type="reset" value="重 设" />    <input type="submit" value="更 新" /></form>
                    <?php if(get(&#39;id&#39;,"")){?><p><form action="" method="POST" style="margin:0;"><input type="submit" name="user" value="保存调试后的openSug在当前服务器上"></form><?php }?></td>
            </tr>
            <tr>
                <td colspan="4" style="text-align:center;color:red;font-size:16px;">本页面仅供参数调试,请调整参数以配合实际生产环境!</td>
            </tr>

            <tr>
                <td colspan="4"><textarea style="width:99%;border:none;overflow-y:visible;resize:none;font-size:14px;color:blue;" rows="13" cols="10" id="out" spellcheck="false" onFocus="select();" name="conf"><?php echo !empty($_GET[&#39;sugResult&#39;])?strtolower($_GET[&#39;sugResult&#39;]):&#39;BaiduSuggestion&#39;?>.bind(&#39;<?php echo get(&#39;id&#39;, &#39;inputObj&#39;). "&#39;, {  //输入框ID\r\n      \"XOffset\": \"".get(&#39;XOffset&#39;, &#39;-15&#39;)."\",// 提示框位置横向偏移量,单位px\r\n      \"YOffset\": \"".get(&#39;YOffset&#39;, &#39;-30&#39;)."\",// 提示框位置纵向偏移量,单位px\r\n      \"width\": \"".get(&#39;width&#39;, "")."\",// 提示框宽度,单位px\r\n      \"fontColor\": \"".get(&#39;fontColor&#39;, &#39;#FF0000&#39;)."\",// 提示框文字颜色\r\n      \"fontColorHI\": \"".get(&#39;fontColorHI&#39;, &#39;#FFFFFF&#39;)."\",// 提示框高亮选择时文字颜色\r\n      \"fontSize\": \"".get(&#39;fontSize&#39;, &#39;28px&#39;)."\",// 文字大小\r\n      \"fontFamily\": \"".get(&#39;fontFamily&#39;, &#39;Microsoft YaHei&#39;)."\",// 文字字体\r\n      \"borderColor\": \"".get(&#39;borderColor&#39;, &#39;#008000&#39;)."\",// 提示框的边框颜色\r\n      \"bgcolorHI\": \"".get(&#39;bgcolorHI&#39;, &#39;#FF6600&#39;)."\",// 提示框高亮选择的颜色\r\n";?>
      "sugSubmit": <?php if(get(&#39;sugSubmit&#39;, &#39;-1&#39;)!=&#39;false&#39;)echo &#39;true&#39;;else echo &#39;false&#39;;?>// 选中提示框中词条时是否提交表单
  }<?php if(!empty($_GET[&#39;confirmCallback&#39;])){echo &#39;, &#39;. $_GET[&#39;confirmCallback&#39;];}?>);</textarea><?php if(!empty($userJS))echo &#39;<p style="background-color:#b0e0b0;color:#006000;padding:5px;">您的专属openSug.js文件:<a href="&#39;. H .&#39;/user/&#39;. $userJS .&#39;" target="_blank">&#39;. H .&#39;/user/&#39;. $userJS .&#39;</a> [<a href="?dl=&#39;. $userJS .&#39;" target="_blank">下载</a>]</p>&#39;;?></td>
              </tr>
            </table>
            
        </div>
        <?php }elseif($n==&#39;qun&#39;){?>
        <div class="list">
        <div class="item title">
            <div class="c-list-title">加入QQ群讨论</div>
        </div>
        <div class="item" style="padding:10px;word-wrap:break-word;">
        <?php if(file_exists(Q)){$tmp=explode(&#39;|&#39;,file_get_contents(Q));$cou=count($tmp)-2;for($i=0;$i<=$cou;$i++){$tt=explode(&#39;,&#39;,$tmp[$i]);$last=$i==$cou?&#39; style="color:red;font-weight:bold;text-decoration:underline" title="最新分享群讨论 &#39;.$tt[0].&#39;"&#39;.$tt[0]:"";echo empty($tt[1])?&#39;<span&#39;.$last.&#39; onclick="prompt(\&#39;请手动加群:\&#39;,&#39;.$tt[0].&#39;);">&#39;.$tt[0].&#39;</span>    &#39;:&#39;<a href="https://shang.qq.com/wpa/qunwpa?idkey=&#39;.$tt[1].&#39;" target="_blank"&#39;.$last.&#39;>&#39;.$tt[0].&#39;</a>    &#39;;}}?>
        </div>
        <form action="" method="post">
        <a href="https://qun.qq.com/join.html" target="_blank">shang.qq.com/wpa/qunwpa?idkey=</a><input type="text" name="link" style="width:30%" autocapitalize="off" autocomplete="off" autocorrect="off" autofocus="autofocus" value="<?php echo $l;?>" /><br />
        群号码:<input type="text" name="qun" style="width:15%" autocapitalize="off" autocomplete="off" autocorrect="off" value="<?php echo $q;?>" /><input type="submit" value="提交" />
        <?php if(isset($qunt))echo &#39; &#39;.$qunt;?>
        </form>
        </div>
        <?php }elseif($n==&#39;friend&#39;){?>
        <div class="list">
            <form action="" method="post" style="text-align:center">节点:<input type="text" name="friend" style="width:70%" autocapitalize="off" autocomplete="off" autocorrect="off" autofocus="autofocus" value="<?php echo $f;?>" /><input type="submit" value="提交" /></form>
    <p>
    <div class="item title"><div class="c-list-title">openSug分流节点</div></div>
    <div class="item" style="padding:10px;word-wrap:break-word;">
    <?php if(file_exists(F)){
        $tmp=explode(&#39;|&#39;,file_get_contents(F));
        $cou=count($tmp)-2;
        for($i=0;$i<=$cou;$i++){
            $url = parse_url($tmp[$i]);
            echo &#39;<a style="color:red;font-weight:bold;text-decoration:underline" href="&#39;. $tmp[$i] .&#39;" target="_blank">&#39;. $url[&#39;host&#39;] .&#39;</a>    &#39;;
        }
    }?></div>
    </p>
    </div>
    <?php }else{?>
    <div class="list">
        <div class="item-1st">
            <div class="item title">
                <div class="c-list-title">baiduSug = "1"</div>
            </div>
            <div class="item">
                <div class="c-list-title">
                    <form style="background:none" action="https://www.baidu.com/s" method="GET" name="gs" target="_blank" onSubmit="return q.value!=""" role="search"><input type="hidden" name="si" value="<?php echo S;?>" /><input name="ct" type="hidden" value="2097152" /><div class="DEMO1"><div class="msfo"><div style="background-color:#fff !important;border-color:#cae6ff;border-style:solid;border-width:2px 1px 2px 2px;border-right:none;margin-top:-1px;padding:0;padding-right:0;height:35px;padding-right:0;border:1px solid #E3E3E3 !important;border-right:none !important;border-top:1px solid #E3E3E3 !important;zoom:1;position:relative"><div style="display:-webkit-box;display:-webkit-flex;display:flex;padding:5px 0;"><input type="text" class="DEMO3 DEMO0 DEMO4" maxlength="2048" name="wd" autocapitalize="off" autocomplete="off" autocorrect="off" autofocus="autofocus" placeholder="baiduSug = &#39;1&#39;" baiduSug="1" /></div></div></div><button type="submit" class="DEMO5"><div class="sbico">搜索</div></button>    </div>
                    </form>
                    选中词条时<span style="color:red;">默认执行</span>表单提交动作
                </div>
            </div>
            <div class="code">
                <pre class="brush:php;toolbar:false"><form action="https://www.baidu.com/baidu" target="_blank"><br />    <input <span style="color:blue">type</span>="<span style="color:red">text</span>" <span style="color:blue">baiduSug</span>="<span style="color:red">1</span>" name="word" size="30" /><br />    <input type="submit" value="百度搜索" /><br /></form>
                              
            
                
baiduSug = "2"
            
            
                
                    
                        " />                                                  
                            
                                
                                    
                                                                             
                                
                            
                                                     
                    
                    选中词条时不执行表单提交动作                 
            
            
                
ba27322eaa259bd2ef2c18d2bbae7692<br>    dcd888538dbb1e85489010388f09f1e8<br>    0f3779d773fa274568376d3e87704f8b<br>f5a47148e367a6035fd7a2faa965022e
            
        
        
            
                
API
            
            
                
                    
BaiduSuggestion.bind();
                    
                
                
提供“百度搜索框提示”API,打造您的个性化搜索框提示功能!  获得开始...
            
                 更新日志';         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代码请尽量添加到网页中  闭合标签之前.
        * 如使用utf-8编码,请务必在script标签中设置 charset="gbk" 属性,否则搜索提示词会出现乱码.已修正!
后面','');">
为受窘的人说一句解围的话;为沮丧的人说一句鼓励的话;为疑惑的人说一句提醒的话;为自卑的人说一句自信的话;为痛苦的人说一句安慰的话...因为,更多时候,我们需要的是雪中送炭,而不是锦上添花.
PHP를 사용하여 openSug.js의 매개변수 디버깅을 구현하는 방법(코드 예) PHP를 사용하여 openSug.js의 매개변수 디버깅을 구현하는 방법(코드 예) PHP를 사용하여 openSug.js의 매개변수 디버깅을 구현하는 방법(코드 예) 
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',"") .'";';?> <script></script> <script><?php echo !empty($_GET[&#39;sugResult&#39;])?strtolower($_GET[&#39;sugResult&#39;]):&#39;BaiduSuggestion&#39;?>.bind(&#39;inputObj&#39;, {"XOffset":"<?php echo get(&#39;XOffset&#39;, &#39;-15&#39;);?>","YOffset":"<?php echo get(&#39;YOffset&#39;, &#39;-30&#39;);?>", "width":"<?php echo get(&#39;width&#39;, "");?>","fontColor":"<?php echo get(&#39;fontColor&#39;, &#39;#FF0000&#39;);?>","fontColorHI":"<?php echo get(&#39;fontColorHI&#39;, &#39;#FFFFFF&#39;);?>","fontSize":"<?php echo get(&#39;fontSize&#39;, &#39;28px&#39;);?>","fontFamily":"<?php echo get(&#39;fontFamily&#39;, &#39;Microsoft YaHei&#39;);?>","borderColor":"<?php echo get(&#39;borderColor&#39;, &#39;#008000&#39;);?>","bgcolorHI":"<?php echo get(&#39;bgcolorHI&#39;, &#39;#FF6600&#39;);?>","sugSubmit":<?php if(get(&#39;sugSubmit&#39;, &#39;-1&#39;)!=&#39;false&#39;)echo &#39;true&#39;;else echo &#39;false&#39;;?>}<?php if(!empty($_GET[&#39;confirmCallback&#39;])){echo &#39;, &#39;. $_GET[&#39;confirmCallback&#39;];}?>);</script> <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"slide":{"type":"slide","bdImg":"4","bdPos":"left","bdTop":"109.5"},"image":{"viewList":["sqq","qzone","tsina","tqq","renren","weixin"],"viewText":"分享到:","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["sqq","qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName(&#39;head&#39;)[0]||body).appendChild(createElement(&#39;script&#39;)).src=&#39;https://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=&#39;+~(-new Date()/36e5)];var _hmt=_hmt||[];(function(){var hm=document.createElement("script");hm.src="https://hm.baidu.com/hm.js?746c3f6346fae8612933e5921803ee32";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm,s)})();<?php if(isset($Msg ))echo&#39;alert("&#39;. $Msg .&#39;");&#39;;?></script>
<script>.js"></script>
<script></script>

위 내용은 PHP를 사용하여 openSug.js의 매개변수 디버깅을 구현하는 방법(코드 예)의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명
이 기사는 博客园에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제
PHP의 목적 : 동적 웹 사이트 구축PHP의 목적 : 동적 웹 사이트 구축Apr 15, 2025 am 12:18 AM

PHP는 동적 웹 사이트를 구축하는 데 사용되며 해당 핵심 기능에는 다음이 포함됩니다. 1. 데이터베이스와 연결하여 동적 컨텐츠를 생성하고 웹 페이지를 실시간으로 생성합니다. 2. 사용자 상호 작용 및 양식 제출을 처리하고 입력을 확인하고 작업에 응답합니다. 3. 개인화 된 경험을 제공하기 위해 세션 및 사용자 인증을 관리합니다. 4. 성능을 최적화하고 모범 사례를 따라 웹 사이트 효율성 및 보안을 개선하십시오.

PHP : 데이터베이스 및 서버 측 로직 처리PHP : 데이터베이스 및 서버 측 로직 처리Apr 15, 2025 am 12:15 AM

PHP는 MySQLI 및 PDO 확장 기능을 사용하여 데이터베이스 작업 및 서버 측 로직 프로세싱에서 상호 작용하고 세션 관리와 같은 기능을 통해 서버 측로 로직을 처리합니다. 1) MySQLI 또는 PDO를 사용하여 데이터베이스에 연결하고 SQL 쿼리를 실행하십시오. 2) 세션 관리 및 기타 기능을 통해 HTTP 요청 및 사용자 상태를 처리합니다. 3) 트랜잭션을 사용하여 데이터베이스 작업의 원자력을 보장하십시오. 4) SQL 주입 방지, 디버깅을 위해 예외 처리 및 폐쇄 연결을 사용하십시오. 5) 인덱싱 및 캐시를 통해 성능을 최적화하고, 읽을 수있는 코드를 작성하고, 오류 처리를 수행하십시오.

PHP에서 SQL 주입을 어떻게 방지합니까? (준비된 진술, pdo)PHP에서 SQL 주입을 어떻게 방지합니까? (준비된 진술, pdo)Apr 15, 2025 am 12:15 AM

PHP에서 전처리 문과 PDO를 사용하면 SQL 주입 공격을 효과적으로 방지 할 수 있습니다. 1) PDO를 사용하여 데이터베이스에 연결하고 오류 모드를 설정하십시오. 2) 준비 방법을 통해 전처리 명세서를 작성하고 자리 표시자를 사용하여 데이터를 전달하고 방법을 실행하십시오. 3) 쿼리 결과를 처리하고 코드의 보안 및 성능을 보장합니다.

PHP 및 Python : 코드 예제 및 비교PHP 및 Python : 코드 예제 및 비교Apr 15, 2025 am 12:07 AM

PHP와 Python은 고유 한 장점과 단점이 있으며 선택은 프로젝트 요구와 개인 선호도에 달려 있습니다. 1.PHP는 대규모 웹 애플리케이션의 빠른 개발 및 유지 보수에 적합합니다. 2. Python은 데이터 과학 및 기계 학습 분야를 지배합니다.

PHP 실행 : 실제 예제 및 응용 프로그램PHP 실행 : 실제 예제 및 응용 프로그램Apr 14, 2025 am 12:19 AM

PHP는 전자 상거래, 컨텐츠 관리 시스템 및 API 개발에 널리 사용됩니다. 1) 전자 상거래 : 쇼핑 카트 기능 및 지불 처리에 사용됩니다. 2) 컨텐츠 관리 시스템 : 동적 컨텐츠 생성 및 사용자 관리에 사용됩니다. 3) API 개발 : 편안한 API 개발 및 API 보안에 사용됩니다. 성능 최적화 및 모범 사례를 통해 PHP 애플리케이션의 효율성과 유지 보수 성이 향상됩니다.

PHP : 대화식 웹 컨텐츠를 쉽게 만들 수 있습니다PHP : 대화식 웹 컨텐츠를 쉽게 만들 수 있습니다Apr 14, 2025 am 12:15 AM

PHP를 사용하면 대화식 웹 컨텐츠를 쉽게 만들 수 있습니다. 1) HTML을 포함하여 컨텐츠를 동적으로 생성하고 사용자 입력 또는 데이터베이스 데이터를 기반으로 실시간으로 표시합니다. 2) 프로세스 양식 제출 및 동적 출력을 생성하여 htmlspecialchars를 사용하여 XSS를 방지합니다. 3) MySQL을 사용하여 사용자 등록 시스템을 작성하고 Password_Hash 및 전처리 명세서를 사용하여 보안을 향상시킵니다. 이러한 기술을 마스터하면 웹 개발의 효율성이 향상됩니다.

PHP 및 Python : 두 가지 인기있는 프로그래밍 언어를 비교합니다PHP 및 Python : 두 가지 인기있는 프로그래밍 언어를 비교합니다Apr 14, 2025 am 12:13 AM

PHP와 Python은 각각 고유 한 장점이 있으며 프로젝트 요구 사항에 따라 선택합니다. 1.PHP는 웹 개발, 특히 웹 사이트의 빠른 개발 및 유지 보수에 적합합니다. 2. Python은 간결한 구문을 가진 데이터 과학, 기계 학습 및 인공 지능에 적합하며 초보자에게 적합합니다.

PHP의 지속적인 관련성 : 여전히 살아 있습니까?PHP의 지속적인 관련성 : 여전히 살아 있습니까?Apr 14, 2025 am 12:12 AM

PHP는 여전히 역동적이며 현대 프로그래밍 분야에서 여전히 중요한 위치를 차지하고 있습니다. 1) PHP의 단순성과 강력한 커뮤니티 지원으로 인해 웹 개발에 널리 사용됩니다. 2) 유연성과 안정성은 웹 양식, 데이터베이스 작업 및 파일 처리를 처리하는 데 탁월합니다. 3) PHP는 지속적으로 발전하고 최적화하며 초보자 및 숙련 된 개발자에게 적합합니다.

See all articles

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
4 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
4 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
4 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25 : Myrise에서 모든 것을 잠금 해제하는 방법
1 몇 달 전By尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

PhpStorm 맥 버전

PhpStorm 맥 버전

최신(2018.2.1) 전문 PHP 통합 개발 도구

WebStorm Mac 버전

WebStorm Mac 버전

유용한 JavaScript 개발 도구

Atom Editor Mac 버전 다운로드

Atom Editor Mac 버전 다운로드

가장 인기 있는 오픈 소스 편집기

Dreamweaver Mac版

Dreamweaver Mac版

시각적 웹 개발 도구