php+ajax实现google搜索功能一[原创]
//
原创作品
本站原创:www.111cn.net
作者:面条爱兔子 QQ:271728967
注明:转载请说明原出去 http://www.111cn.net
//
现在长沙下着大雪啊,晚上回家也没什么事作,白天在公司写一个BBS完成了一部份,突然昨天听一个网友说如果能实现google效果就好了,今天无聊之下就想了想,觉得这个用ajax做应该不是什么难道了,就试着写了,说句实话我学ajax时间很短,也只懂皮毛了,各位看了后别丢石头了,把钱包丢过来吧,过年没钱用,;)呵呵.好了废话就不多说了下面进行正题.
首先我总体的简介一下,我只用了两个文件了,因为是测试所以就不分那么清楚了,把js文件和html写在一个文件test.html里面了,还有一个就是php文件post.php了,这个文件用来处理ajax发送过来的数进行处理,再由ajax把数据返回给test.html里面的div, 原理不这么简单了,下面我们来看代码.
第一步创建数据表:test
CREATE TABLE `test` (
`id` int(4) NOT NULL auto_increment,
`title` varchar(50) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312 AUTO_INCREMENT=5 ;
好了数据库创建成功了我们就来建立test.html文件,这个文件很简单,就是一个表单和一个div和CSS
<style>
<!--
body{font-size:12px;}
#show{border:1px solid #9abcde; line-height:23px; width:200px; margin:0px;}
#show li{list-style:none;}
#sug{margin:0px auto;}
-->
</style>
上面为CSS了就是用来控制效果的,
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form1" method="post" action=""><tr>
<td>
<input name="key" type="text" id="key" onFocus="other();" onKeyDown="sugguest();" onBlur="losefouse();" size="27" autocomplete=off >
<input type="submit" name="Submit" value="111cn搜索">
</td>
</tr></form>
<tr>
<td><div id="sug" onClick="javascript:func();"></div></td>
</tr>
</table>
这上面为内容了,关于函数我们下面来具体的说明.
第二步:就是js和xmlhttp的处理和调用了.
创建xmlhttp,这个函数我上次讲ajax+php模仿window文件管理器时讲过了,在用户注册也讲过了,这里不不说了,具体地址请到:
var xmlHttp = false;
function ajaxcreate(){
try {xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
xmlHttp = false;
}
}
if (!xmlHttp && typeof XMLHttpRequest != \\\'undefined\\\') {
xmlHttp = new XMLHttpRequest();
}
if(!xmlHttp){alert(\\\'Create Xmlhttp Fail \\\');return false;}
}
下面这个函数sugguest()作用是取得key的值并发送给post文件进行处理,再调用returnstate()函数
function sugguest(){
ajaxcreate();
var xmvalue=document.getElementById("key").value;
var url="post.php?key="+encodeURI(xmvalue)+"rnd="+Math.random();
if (xmvalue== null || xmvalue.length>20 || xmvalue == "") return false;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.send(xmvalue);
xmlHttp.onreadystatechange=returnstate;
}
下面returnstate()函数是判断xmlhttp的状态是否等4,4表示发送成功,其实还一个200表示接收完毕
function returnstate(){
if(xmlHttp.readyState != 4 ){
document.getElementById("sug").innerHTML="plase wait....";
}
if(xmlHttp.readyState == 4 ){
document.getElementById("sug").innerHTML=xmlHttp.responseText;
}
}
后面这些函数就是一些基本的处理我就不讲了,
function fillin(str){
document.getElementById(\\\'key\\\').value=str;
obj =document.getElementById(\\\'sug\\\');
obj.innerHTML=\\\'\\\';
obj.style.display=\\\'none\\\';
}
function other(){
document.getElementById(\\\'sug\\\').style.display=\\\'block\\\';
}
function losefouse(){
setInterval("func()",4000);
var time=setInterval("func()",1000);
clearTimeout(time);
}
function func(){
ob=document.getElementById(\\\'sug\\\');
ob.style.display = \\\'none\\\';
}
最后面就是post.php文件了,接着下一篇了.
php+ajax实现google搜索功能二[原创]
效果浏览地址:http://www.111cn.net/test/test.html
//
原创作品
本站原创:www.111cn.net
作者:面条爱兔子 QQ:271728967
注明:转载请说明原出去 http://www.111cn.net
//
现在来讲一下post.php文件了,post.php文件很简单,这个不一定用php可以用很多,只要是服务器脚都可以完成,{个人意见}
header("Content-type:text/html;charset=gb2312");我只说讲这一句了,设置文档编码.
$key =isset($_POST['key'])?$_POST['key']:'';
$sql ="select title from test where title like '%$key%' order by title desc";
$result =mysql_query($sql) or die(mysql_error());
echo"<div id=show >";
while ($rs =mysql_fetch_array($result) ){
echo "<li onMouseOver=\"this.style.background='#d7ebff'\" onMouseOut=\"this.style.background='#ffffff'\" onclick=\"javascript:fillin(this.innerHTML);\">".$rs['title']."</li>";
}
echo"</div>";
php+ajax实现google搜索功能二[原创].
浏览地址:http://www.111cn.net/test/test.html
调用
<?php
/**
* 新浪博客编辑器PHP版封装类调用方法
*
*/
header(\'Content-Type:text/html;Charset=utf-8;\');
include_once(\'sinaEditor.class.php\');
extract($_POST);
extract($_GET);
unset($_POST,$_GET);
$act==\'subok\' && die("提交的内容是:<br>".htmlspecialchars($gently_editor));
$editor=new sinaEditor(\'gently_editor\');
$editor->Value=\'<h2>这个是一个测试!</h2><br>
我的博客:<a href="111cn.net\';
$editor->BasePath=\'.\';
$editor->Height=500;
$editor->Width=700;
$editor->AutoSave=false;//是否自动保存!!
?>
<form name="form1" id="form1" method="post" action="index.php?act=subok">
<?
$editor->Create();
?>
<input type="submit" value="提交">
<input type="reset" value="重置">
</form>
效果图
下载地址:点击下载
复制PHP内容到剪贴板PHP代码:
<?php
$winmain=wb_create_window(null,AppWindow,'21点游戏',WBC_CENTER,WBC_CENTER,800,495,0,0);
wb_create_control($winmain,Label,'庄家',20,15,40,30,LB_1,0,0,0);
wb_create_control($winmain,Label,'玩家',20,200,40,30,LB_2,00,0,0);
wb_create_control($winmain,Frame,'',80,40,120,150,FR_PC_1,0,0,0);
wb_create_control($winmain,Frame,'',220,40,120,150,FR_PC_2,0,0,0);
wb_create_control($winmain,Frame,'',360,40,120,150,FR_PC_3,0,0,0);
wb_create_control($winmain,Frame,'',500,40,120,150,FR_PC_4,0,0,0);
wb_create_control($winmain,Frame,'',640,40,120,150,FR_PC_5,0,0,0);
wb_create_control($winmain,Frame,'',645,230,120,150,FR_U_5,0,0,0);
wb_create_control($winmain,Frame,'',500,230,120,150,FR_U_4,0,0,0);
wb_create_control($winmain,Frame,'',360,230,120,150,FR_U_3,0,0,0);
wb_create_control($winmain,Frame,'',220,230,120,150,FR_U_2,0,0,0);
wb_create_control($winmain,Frame,'',80,230,120,150,FR_U_1,0,0,0);
wb_create_control($winmain,Label,'',35,305,25,20,LB_U_T,0,0,0);
wb_create_control($winmain,Label,'',35,110,25,20,LB_P_T,0,0,0);
wb_create_control($winmain,PushButton,'发牌',320,400,70,25,B_GO,0x00000002,0,0);
wb_create_control($winmain,PushButton,'停止',435,400,70,25,B_CHANGE,0x00000002,0,0);
wb_create_control($winmain,Label,'',110,95,60,60,LB_PC_1,0x00000800,0,0);
wb_create_control($winmain,Label,'',250,95,60,60,LB_PC_2,0x00000800,0,0);
wb_create_control($winmain,Label,'',390,95,60,60,LB_PC_3,0x00000800,0,0);
wb_create_control($winmain,Label,'',530,95,60,60,LB_PC_4,0x00000800,0,0);
wb_create_control($winmain,Label,'',670,95,60,60,LB_PC_5,0x00000800,0,0);
wb_create_control($winmain,Label,'',110,285,60,60,LB_U_1,0x00000800,0,0);
wb_create_control($winmain,Label,'',250,285,60,60,LB_U_2,0x00000800,0,0);
wb_create_control($winmain,Label,'',390,285,60,60,LB_U_3,0x00000800,0,0);
wb_create_control($winmain,Label,'',530,285,60,60,LB_U_4,0x00000800,0,0);
wb_create_control($winmain,Label,'',670,285,60,60,LB_U_5,0x00000800,0,0);
wb_create_control($winmain,Label,'',70,20,90,20,PC_MON,0,0,0);
wb_create_control($winmain,Label,'',70,205,90,20,U_MON,0,0,0);
point_include.php文件
<?php
for ($i=1;$i<=13;$i++){
switch($i){
case 1j=1;$key='A';break;
case 11j=10;$key='J';break;
case 12j=10;$key='Q';break;
case 13j=10;$key='K';break;
default:
$key=$j=$i;
}
$card["黑\n桃\n$key"]=$j;
$card["红\n桃\n$key"]=$j;
$card["梅\n花\n$key"]=$j;
$card["方\n片\n$key"]=$j;
}
$contorl_id=array(
'B_GO'=>1001,'B_CHANGE'=>1002,
'ME_START'=>2001,'ME_REMON'=>2002,'ME_AUTHOR'=>2003,'ME_QUIT'=>IDCLOSE,
'LB_1'=>3001,'LB_2'=>3002,'LB_U_T'=>3003,'LB_P_T'=>3004,
'PC_MON'=>3005,'U_MON'=>3006,
'LB_PC_1'=>3101,'LB_PC_2'=>3102,'LB_PC_3'=>3103,'LB_PC_4'=>3104,'LB_PC_5'=>3105,
'LB_U_1'=>3201,'LB_U_2'=>3202,'LB_U_3'=>3203,'LB_U_4'=>3204,'LB_U_5'=>3205,
'FR_PC_1'=>4001,'FR_PC_2'=>4002,'FR_PC_3'=>4003,'FR_PC_4'=>4004,'FR_PC_5'=>4005,
'FR_U_1'=>5001,'FR_U_2'=>5002,'FR_U_3'=>5003,'FR_U_4'=>5004,'FR_U_5'=>5005,
);
foreach ($contorl_id as $key=>$value){
if(!defined(strtoupper($key)))define(strtoupper($key),$value);
}
?>
21point.phpw文件
<?php
set_time_limit(0);
include_once('include/winbinder.php');
include_once('form/point_include.php');
include_once('form/21point.form.php');
class Ponit {
public $key_id;
private $user_point=10000;
private $pc_point=10000;
private $card;
private $player='user';
private $new_term=false;
private $remon=false;
public function __construct($winmain,$card){
$f=file_get_contents('form/db.db');
list($this->user_point,$this->pc_point)=explode('|',$f);
$this->window=$winmain;
$this->card=$card;
$this->prepare();
}
private function prepare(){
wb_set_image($this->window,'form/hyper.ico');
wb_create_control($this->window,Menu,array(
'游戏(&G)' , null,
array(ME_START , "开局\tCrtl+N",'','','Ctrl+N'),
array(ME_REMON , "重计分"),
array(ME_AUTHOR , "作者"),
null ,
array(ME_QUIT , "退出\tCrtl+Q",'','','Ctrl+Q'),
null
));
wb_set_text(wb_get_control($this->window,U_MON),$this->user_point.'分');
wb_set_text(wb_get_control($this->window,PC_MON),$this->pc_point.'分');
$font=wb_create_font("Arial", 13, null, FTA_BOLD);
wb_set_font(wb_get_control($this->window,LB_1),$font);
wb_set_font(wb_get_control($this->window,LB_2),$font);
$font=wb_create_font("Arial", 34, null, FTA_BOLD);
for($i=1;$i<=5;$i++){
wb_set_font(wb_get_control($this->window,(3100+$i)),$font);
wb_set_font(wb_get_control($this->window,(3200+$i)),$font);
}
}
private function start(){
$this->player='user';
$this->new_term=true;
$this->clear();
$this->play();
wb_set_enabled(wb_get_control($this->window,B_GO),true);
wb_set_enabled(wb_get_control($this->window,B_CHANGE),true);
}
private function stop(){
wb_set_enabled(wb_get_control($this->window,B_GO),false);
wb_set_enabled(wb_get_control($this->window,B_CHANGE),false);
}
private function change_player(){
$this->stop();
$this->player='pc';
$this->play();
}
private function total($num=0,$win){
static $u_tem,$p_tem;
if(empty($u_tem)||empty($p_tem)||$this->remon==true){
$u_tem=$this->user_point;
$p_tem=$this->pc_point;
$this->remon=false;
}
if(strtoupper($win)=='U'){
$u_tem+=$num;
$p_tem-=$num;
}else{
$u_tem-=$num;
$p_tem+=$num;
}
$this->user_point=$u_tem;
$this->pc_point=$p_tem;
wb_set_text(wb_get_control($this->window,U_MON),$this->user_point.'分');
wb_set_text(wb_get_control($this->window,PC_MON),$this->pc_point.'分');
$f=fopen('form/db.db','wb');
fwrite($f,$this->user_point."|".$this->pc_point);
fclose($f);
}
private function remon(){
$this->remon=true;
$this->user_point=10000;
$this->pc_point=10000;
wb_set_text(wb_get_control($this->window,U_MON),$this->user_point.'分');
wb_set_text(wb_get_control($this->window,PC_MON),$this->pc_point.'分');
$f=fopen('form/db.db','wb');
fwrite($f,$this->user_point."|".$this->pc_point);
fclose($f);
}
private function clear(){
wb_set_text(wb_get_control($this->window,LB_U_T),'');
wb_set_text(wb_get_control($this->window,LB_P_T),'');
for($i=1;$i<=5;$i++){
wb_set_text(wb_get_control($this->window,(4000+$i)),'');
wb_set_text(wb_get_control($this->window,(5000+$i)),'');
wb_set_text(wb_get_control($this->window,(3100+$i)),'');
wb_set_text(wb_get_control($this->window,(3200+$i)),'');
}
}
private function play(){
static $card_tem=array(),$i=0,$j=0,$user_total=0,$pc_total=0;
if($this->new_term==true){
$card_tem=$this->card;
$this->new_term=false;
$user_total=0;
$pc_total=0;
$i=0;$j=0;
}
if($this->player=='user'){
$i++;
$card_key=array_rand($card_tem);
$card_value=$card_tem[$card_key];
$user_total+=$card_value;
wb_set_text(wb_get_control($this->window,LB_U_T),$user_total.'点');
wb_set_text(wb_get_control($this->window,(5000+$i)),$card_key);
wb_set_text(wb_get_control($this->window,(3200+$i)),$card_value);
if($i>=5 && $user_total<=21){
$this->total(20,'U');
$sel=wb_message_box($this->window,"恭喜你,5张全小,玩家获胜!\n您还想继续玩吗?",'胜利',WBC_YESNO);
$sel==1?$this->start():$this->stop();
}elseif($user_total>21){
$this->total(20,'P');
$sel=wb_message_box($this->window,"真不幸,超过21点,庄家获胜!\n您还想继续玩吗?",'失败',WBC_YESNO);
$sel==1?$this->start():$this->stop();
}
}else{
$j++;
$card_key=array_rand($card_tem);
$card_value=$card_tem[$card_key];
$pc_total+=$card_value;
wb_set_text(wb_get_control($this->window,LB_P_T),$pc_total.'点');
wb_set_text(wb_get_control($this->window,(4000+$j)),$card_key);
wb_set_text(wb_get_control($this->window,(3100+$j)),$card_value);
if($j>=5 && $pc_total<=21){
$this->total(20,'P');
$sel=wb_message_box($this->window,"庄家5张全小,庄家获胜!\n您还想继续玩吗?",'失败',WBC_YESNO);
$sel==1?$this->start():$this->stop();
}elseif($pc_total>21){
if( $pc_total-$card_value<$user_total){
$this->total(20,'U');
$sel=wb_message_box($this->window,"恭喜你,庄家点数超过21点,玩家获胜!\n您还想继续玩吗?",'胜利',WBC_YESNO);
$sel==1?$this->start():$this->stop();
}else{
$pc_total=$pc_total-$card_value;
wb_set_text(wb_get_control($this->window,LB_P_T),$pc_total.'点');
wb_set_text(wb_get_control($this->window,(4000+$j)),'');
wb_set_text(wb_get_control($this->window,(3100+$j)),'');
if($pc_total>=$user_total){
$this->total(20,'P');
$msg=($pc_total==$user_total)?"双方点数一样,庄家获胜!\n您还想继续玩吗?":"庄家点数比你大,庄稼获胜!\n您还想继续玩吗?";
$sel=wb_message_box($this->window,$msg,'失败',WBC_YESNO);
$sel==1?$this->start():$this->stop();
}else{
$this->total(20,'U');
$sel=wb_message_box($this->window,"恭喜你,庄家点数比你小,玩家获胜!\n您还想继续玩吗?",'胜利',WBC_YESNO);
$sel==1?$this->start():$this->stop();
}
}
}else{
usleep(800000);
$this->play();
}
}
unset($card_tem[$card_key]);
}
private function author(){
$inf="大家好,偶是machine_马,\n\n这是我人生中的第一个桌面应用程序,\n\n做得很烂,大家见笑了,哈哈哈^_^。\n\n\n\n\t\t作者:machine_马";
$author_window=wb_create_window($this->window,ModalDialog,'作者简介',WBC_CENTER, WBC_CENTER, 360, 180, 0x00000000, 0);
wb_set_handler($author_window,'author_handler');
$image=wb_create_control($author_window,Frame,'123',0,0,128,144,110,WBC_IMAGE);
wb_create_control($author_window,Label,$inf,140,20,200,150,120,WBC_IMAGE);
wb_set_image($image, 'form/author.bmp', NOCOLOR);
}
public function main(){
switch ($this->key_id){
case IDCLOSE:
wb_destroy_window($this->window); break;
case ME_START:
$this->start(); break;
case ME_AUTHOR:
$this->author(); break;
case B_GO:
$this->play(); break;
case B_CHANGE:
$this->change_player(); break;
case ME_REMON:
$this->remon(); break;
}
}
}
$wbd=new Ponit($winmain,$card);
wb_set_handler($winmain,'go_to');
wb_main_loop();
function go_to($window,$id){
global $wbd;
$wbd->key_id=$id;
return $wbd->main();
}
function author_handler($this_window,$id){
switch($id){
case IDCLOSE:
wb_destroy_window($this_window);
}
}
?>
function hidden(){
var obj = document.getElementById(\'Layer1\');
obj.style.display=\'none\';
}
function myMenuShow(obj,btn,past)
{
document.getElementById("subMenu").innerHTML="<li onMouseOver=\\"this.style.backgroundColor=\'#F5FBFF\'\\" onMouseOut=\\"this.style.backgroundColor=\'\'\\" onclick=\\"Createfolder();\\" >新建文件夹</li><li onMouseOver=\\"this.style.backgroundColor=\'#F5FBFF\'\\" onMouseOut=\\"this.style.backgroundColor=\'\'\\" onclick=\\"CreateText();\\" >新建文本文件</li><hr> <li onMouseOver=\\"this.style.backgroundColor=\'#F5FBFF\'\\" onMouseOut=\\"this.style.backgroundColor=\'\'\\" onclick=\\"return Copy(\'"+btn+"\',\'s\')\\">复 制</li><li onMouseOver=\\"this.style.backgroundColor=\'#F5FBFF\'\\" onMouseOut=\\"this.style.backgroundColor=\'\'\\" onclick=\\"return Copy(\'"+btn+"\',\'c\')\\">剪 切</li><li onMouseOver=\\"this.style.backgroundColor=\'#F5FBFF\'\\" onMouseOut=\\"this.style.backgroundColor=\'\'\\" onclick=\\"return Past(\'filepath\',\'"+past+"\')\\">粘 贴</li> <hr><li onMouseOver=\\"this.style.backgroundColor=\'#F5FBFF\'\\" onMouseOut=\\"this.style.backgroundColor=\'\'\\" onclick=\\"del(\'"+btn+"\');\\">删 除</li> <hr><li onMouseOver=\\"this.style.backgroundColor=\'#F5FBFF\'\\" onMouseOut=\\"this.style.backgroundColor=\'\'\\" onclick=\\"alert(\'你单击文件名就可重命名!\');\\" >重命名</li><br/>";
ShowMenu(obj,0,0);
return false;
}
document.onmousemove=hiddenSubMenu;
attachEvent(\'onload\', loadsubMenu);// JavaScript Document
最后面就是调用函数,
再此文件管理系统也就写完了,希望能给各位有点帮助,也同时希望各位高手指点,本系统还有很多地方待修改提高了,
下载地下:php+ajax源码
相关文章
- 这篇文章主要介绍了vue+高德地图实现地图搜索及点击定位操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-09-09
- 这篇文章主要介绍了C#实现图片放大功能的按照像素放大图像方法,功能非常实用,需要的朋友可以参考下...2020-06-25
- 我们这个做法是把搜索结果出来,与搜索关键词相同的替换成高亮的字, 我们会用到str_replace(你找的关键字,你找的关键字,$str); 就这么容易了,好了下面我们来看一...2016-11-25
- 在本篇文章中小编给各位整理了一篇关于python中翻译功能translate模块实现方法,有需要的朋友们可以参考下。...2020-12-18
- 用户为满足自己某种需求而来到搜索引擎的,判断用户的需求是做好网站的开始。只有准确地判断出用户需求,了解用户搜索的目的,才能合理地衡量出一个网站结果的质量好,做好搜...2016-10-10
- AngularJS 让人爱不释手的八种功能,想知道AngularJS哪八种功能让人喜欢就快点看下本文吧...2016-03-28
- 这篇文章主要给大家介绍了关于微信小程序实现导航功能的操作步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2021-03-10
- php搜索csv中的数据原理是打开csv文件,然后一行行搜索指定的内容是否包含在我们读取这代码中,如果是返回true。 //搜索csv中指定内容 代码如下 复制代码...2016-11-25
- EMUI11值得升级吗?好不好用?下面小编带来EMUI11上手体验,一起来看看手机鸿蒙OS的提前预演...2020-12-08
基于element-ui封装可搜索的懒加载tree组件的实现
这篇文章主要介绍了基于element-ui封装可搜索的懒加载tree组件的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2020-05-23- phpmyadmin还有高级功能可能大部份站长不知道吧,今天本文章就来给大家介绍phpMyAdmin 高级功能设置的方法图解,希望文章对大家会有所帮助。 phpMyAdmin 安装后,默认...2016-11-25
- 这篇文章主要介绍了pycharm 如何取消连按两下shift出现的全局搜索?下面小编就为大家介绍一下解决方法,还等什么?一起跟随小编过来看看吧...2021-01-16
- 小爱同学5.0即将发布,据已知报道小爱同学5.0将新增机型,跟着小编一起来看看吧,顺便了解下即将都有哪些新功能面市吧...2020-12-08
- 这篇文章主要介绍了Angular2搜索和重置按钮过场动画,需要的朋友可以参考下...2017-05-27
- 这篇文章主要为大家分享了一份很全面的JavaScript常用功能汇总集合,一些常用的额JS 对象、基本数据结构、功能函数等,感兴趣的小伙伴们可以参考一下...2016-01-24
Night Shift是什么意思 Night Shift有什么功能及作用?
Night Shift是IOS9.3正式版系统新增加的功能之一,很多伙伴们都不清楚Night Shift是什么意思?以及Night Shift有什么用途?对此,本文小编就为大家详细介绍Night Shift的含义及作用...2016-07-04- 带搜索功能下拉框在项目中经常会用到,下面小编把实现代码分享到脚本之家平台,供大家参考...2016-05-13
- <?php include_once("mime.inc"); $mm = new MIME(); $to = "customer@263.net"; $subject = $mm->encode("商城","gb2312"); // 编码 $msg = "注册会员成功<br>"; $m...2016-11-25
- 一个网站要想成功注册,它起码应具备两个条件,一是网站本身要有较好的内容和设计,二是网站没有作弊行为。这里所谓的“作弊”,是指采用一些特殊的、有悖常规的网...2016-09-20
- PHP对于数据库的搜索主要通过使用SQL语句中的like子句来实现。如果同时搜索多个关键词,可以使用union子句来将搜索结果合并起来。以下代码实现了一个搜索页面...2016-11-25