<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="javascript教程">
check111cnNet()
{
var keyword = myfm.keyword.value;
if( keyword =='' )
{
alert('www.111cn.net提示你:请输入要查询的内容');
return false;
}
}
</script>
</head>
<body>
<form id="myfm" name="myfm" method="post" action="">
<label>
输入查询关键字:
<input type="text" name="keyword" />
</label>
<label>
<input type="submit" name="Submit" value="提交" onClick="return check111cnNet();" />
</label>
</form>
</body>
</html>
<?php
// 创建数据库教程连接
mysql教程_connect('localhost','111cn.net','www.111cn.net');
mysql_select_db('www.111cn.net');//数据库选择
mysql_query('set names "gbk"');
//进度查询操作
if($_POST)
{
$keyword = $_POST['keyword'];
$sql = "Select * from search where title like '%$keyword%' limit 0,10";
$query = mysql_query($sql ) or die("www.111cn.net提示你:查询出错了");
if( mysql_num_rows( $query ) )
{
while( $rs = mysql_fetch_array( $query ) )
{
echo $rs['title'];
}
}
else
{
echo '没有要找的内容';
}
}
/*
数据表结构
CREATE TABLE `111cnNet`.`test` (
`id` INT( 8 ) NOT NULL AUTO_INCREMENT ,
`title` CHAR( 150 ) NULL ,
`content` TEXT NULL ,
PRIMARY KEY ( `id` )
) ENGINE
*/
//函数解析
mysql_connect //数据库连接了有三个参数分别为 数据库服务器名称,用户名,密码
mysql_select_db//参数有二个,第二个可选 ,第一个数据库名称,第二个数据库连接$connwww.111cn.net
mysql_query('set names "gbk"'); //这一句比较重要,就是设置读取数据库内容的编码了,这句要设置与文档编辑一致,否则可能出现乱码。
mysql_query //数据查询,有二个参数,第一个必须,为sql查询语句。
mysql_num_rows //统计mysql_query查询记录多少条,返回为int型
mysql_fetch_array //读取当前记录集一条记录保存到数组。
$_POST
if else
while
// 纯本站原创转载必须注明来源否则必究责任 来源http://www.111cn.net/phper/php.html
?>
// 创建数据库教程连接
mysql教程_connect('localhost','111cn.net','www.111cn.net');
mysql_select_db('www.111cn.net');//数据库选择
mysql_query('set names "gbk"');
//进度查询操作
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="javascript教程">
check111cnNet()
{
if( myfm.uid.value =='' )
{
alert('www.111cn.net提示你:用户名错误');
return false;
}
if( ! myfm.pwd.value!='' && myfm.pwd.value == myfm.pwd1.value )
{
alert('www.111cn.net提示你:二次密码不正确');
return false;
}
}
</script>
</head>
<body>
<form id="myfm" name="myfm" method="post" action="">
<label>
用户名
<input type="text" name="uid" />
<br>
密码
<input type="text" name="pwd" />
<br>
密码2
<input type="text" name="pwd2" />
<br>
</label>
<label>
<input type="submit" name="Submit" value="注册" onClick="return check111cnNet();" />
</label>
</form>
</body>
</html>
<?php
if($_POST)
{
$uid = $_POST['uid'];
$pwd = $_POST['pwd'];
$pwd1 = $_POST['pwd1'];
if( empty( $uid ) ){exit();}
$sql = "Select * from user where uid ='$uid' limit 0,10";
$query = mysql_query($sql ) or die("www.111cn.net提示你:查询出错了");
if( mysql_num_rows( $query ) )
{
echo '用户己被注册';
}
else
{
if(mysql_query("insert into user(uid,pwd) values('$uid','md5($pwd)')"))
{
echo 'www.111cn.net提示你:注册成功';
}
else
{
echo '注册失败';
}
}
}
/*
数据表结构
CREATE TABLE `111cnNet`.`user` (
`id` INT( 8 ) NOT NULL AUTO_INCREMENT ,
`uid` CHAR( 150 ) NULL ,
`pwd` char(32) NULL ,
PRIMARY KEY ( `id` )
) ENGINE
本教程只供学习用没进行安全处理,如用于商业用途出现任何问题与本站www.111cn.net无关
*/
// 纯本站原创转载必须注明来源否则必究责任 来源http://www.111cn.net/phper/php.html
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>标记地图</title>
<script" width=100% src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAc8Kc8QqRiIgpsK23Kp5gkBSH2hU1_Yr14uOHyNBnrSDSRu1cOxQAA7Zqsv6wfxH6g3z1AadUX7peSA" type="text/javascript教程" charset="utf-8"></script>
<!--改用自己的key-->
<script type="text/javascript">
function save(point,zoom){
o = window.opener;
if (point !=null ) {
o.document.getElementById("layout_map").value='('+point.lng()+','+point.lat()+')';//经度
//o.document.getElementById("map_y").value=point.lat();
o.document.getElementById("layout_zoom").value=zoom;
try {
o.document.getElementById("emarked_img").src = "http://www.111cn.net/images/map/modify_note.gif" ;
}catch(e){}
}
}
function initialize(lng_x) {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));//设置map对象
map.addControl(new GSmallMapControl());//google 控件
try{
var owin;
if(window.opener){
owin = window.opener;
}else{
owin = window.parent;
}
map_x=owin.document.getElementById("layout_map").value;
//map_y=owin.document.getElementById("layout_map").value;
map_z=owin.document.getElementById("layout_zoom").value*1;
if( map_x == null || map_x =="" || map_z =='' )
{
map_x ='(103.974609375,33.284619968887675)';
map_z =4;
}
map_x =map_x.replace('(','');
map_x =map_x.replace(')','');
var temp =map_x.split(',');
map_x = temp[0];
map_y = temp[1];
//if(map_x !=null && map_x != "" && map_z>0 )
//{
thispoint=new GLatLng(map_y,map_x,true);
map.setCenter(thispoint,map_z);
map.addOverlay(new GMarker(thispoint));
//}
//else
//{
// map.setCenter(new GLatLng(37.86455455760559,112.55081176757812), 10);
// alert(map_y);
//}
}catch(e){
//alert(map_z);
map.setCenter(new GLatLng(37.86455455760559,112.55081176757812), 10);//设置中心点
}
//标记事件
GEvent.addListener(map,"click", function(overlay,point) {
map.clearOverlays();//清除原有的标记
map.addOverlay(new GMarker(point));
save(point,map.getZoom());
});
}
}
</script>
<style>
<!--
body{ margin:0px; padding:0px;}
#save{ line-height:1.8em; text-align:center; width:700px;}
-->
</style>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 900px; height: 550px"></div>
<div id="save"><input value="保存标记" onclick="javascript:window.close();" type="button"/></div>
</body>
</html>
mysql教程_connect("localhost","root","root") or die('Database Server Uid or Password Error!');
mysql_select_db('ip') or die('data !');
mysql_query("SET NAMES 'gb2312'");
*/
include("boke/inc/re_conn.php");
$file = 'update.xml';
$url = '<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';
$sql = "Select * from filecontent order by id desc limit 0,100 ";
$query = mysql_query( $sql );
while( $rs = mysql_fetch_array( $query ) )
{
$time = filemtime(substr($rs['s_url'],1));
$s = date("Y-m-d",$time);
$s1 = date("H:i:s+00:00",$time);
$s = $s.'T'.$s1;
$url .= "<url> <loc>http://www.111cn.net".$rs['s_url']."</loc> <priority>1.00</priority> <lastmod>$s</lastmod> <changefreq>hourly</changefreq> </url> ";
}
if( $url )
{
$url .="</urlset>";
null_write($url);
echo '生成网站地图成功<a href='.$file.' target=_blank>查看</a>';
}
function null_write($new)
{
global $file;
$f=fopen($file,"w");
flock($f,LOCK_EX);
fputs($f,$new);
fclose($f);
}
<?php
mysql教程_connect('localhost','root','1******') or die('database server no exists!');
mysql_select_db('wk') or die('database error!');
mysql_query("SET NAMES 'gbk'");//set document charset encode
function CreateXml(){
$tag =0;
$head ='<?xml version="1.0" encoding="gb2312" ?> <channel>';
$sql ="Select * from wk_works order by id desc";
while($rs =mysql_fetch_array($res) ){
if($tag==0){
$stp = "<item class="".$rs['w_type']."" uid="".$rs['m_id']."" name="".$this->get_name($rs['m_id'])."" portrait="".$rs['w_head']."" blogname = "".$rs['blogname']."" url="user.php?id=".$rs['m_id']."" poll = "".$rs['w_support']."" ></item>";
}else{
}
}
$foot ='</channel>';
$cont =fopen("xml/111cn.net.xml",'w');
fwrite($cont,$head.$stp.$foot);
fclose($cont);
}
function get_name($id){
$sqle ="select id,m_uid from wk_member where id='$id'";
$relt = mysql_query($sqle);
$reus = mysql_fetch_array($relt);
return $reus['m_uid'];
}
?>
本站原创转载注明: www.111cn.net