<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 6, comments - 6, trackbacks - 0, articles - 0

    2007年4月13日

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script type="text/javascript">
    /* Create a new XMLHttpRequest object to talk to the Web server */
    function getbw()
    {
        var xmlhttp;
     try {
      xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
     } catch (e) {
      try {
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      } catch (oc) {
       xmlhttp=null;
      }
     }
     if(!xmlhttp && typeof XMLHttpRequest != "undefined")
      xmlhttp = new XMLHttpRequest();
    return xmlhttp;
    }
     
        function IDRequest(n) {
     xmlhttp=getbw();
        //定義收到服務(wù)器的響應(yīng)后需要執(zhí)行的JavaScript函數(shù)
        url=n+document.getElementById('163id').value;//定義網(wǎng)址參數(shù)
        alert(url);
     xmlhttp.open("GET",url, true);       
     xmlhttp.send(null);        
        //xmlhttp_request=getXMLRequester();//調(diào)用創(chuàng)建XMLHttpRequest的函數(shù)       
        xmlhttp.onreadystatechange = doContents;//調(diào)用doContents函數(shù)       

        }   
        function doContents() {       
        if (xmlhttp.readyState == 4) {// 收到完整的服務(wù)器響應(yīng)           
            if (xmlhttp.status == 200) {//HTTP服務(wù)器響應(yīng)的值OK
      
           document.getElementById('message').innerHTML = xmlhttp.responseText;//將服務(wù)器返回的字符串寫到頁面中ID為message的區(qū)域           
            } else {               
            alert(xmlhttp.status);
            }       
            }   
            }
            </script>
    </head>
    <body>
    <input type="text" id="163id" />
    <input type="button" value="校驗(yàn)" onclick="IDRequest('check.php?userid=')" />
    <div id="message"></div>
    </body>
    </html>

    posted @ 2007-04-23 19:10 吳濤濤 閱讀(399) | 評(píng)論 (0)編輯 收藏

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>javascript生成上傳圖像預(yù)覽功能</title>
    </head>
    <body>
    <INPUT id=photo1 style="WIDTH: 350px"   onpropertychange="if(event.propertyName=='value') preview1.src=photo1.value.replace(/\\/g,'/')"
                type=file name=photo1>
    <br />
    <IMG id=preview1 height=66 src="圖片博客-上傳圖片_files/sampe3.jpg"
    width=66 name=preview1>
    </body>
    </html>

    posted @ 2007-04-23 19:09 吳濤濤 閱讀(449) | 評(píng)論 (0)編輯 收藏

    <?
    //utf-8->gb2312函數(shù),本程序沒有用到,僅供參考
    function u2utf82gb($c){
      $str="";
      if ($c < 0x80) {
          $str.=$c;
      } else if ($c < 0x800) {
          $str.=chr(0xC0 | $c>>6);
          $str.=chr(0x80 | $c & 0x3F);
      } else if ($c < 0x10000) {
          $str.=chr(0xE0 | $c>>12);
          $str.=chr(0x80 | $c>>6 & 0x3F);
          $str.=chr(0x80 | $c & 0x3F);
      } else if ($c < 0x200000) {
          $str.=chr(0xF0 | $c>>18);
          $str.=chr(0x80 | $c>>12 & 0x3F);
          $str.=chr(0x80 | $c>>6 & 0x3F);
          $str.=chr(0x80 | $c & 0x3F);
      }
      return iconv('UTF-8', 'GB2312', $str);
    }
    function unescape($str) {
    $str = rawurldecode($str);
    preg_match_all("/(?:%u.{4})|.{4};|&#\d+;|.+/U",$str,$r);
    $ar = $r[0];
    print_r($ar);
    foreach($ar as $k=>$v) {
      if(substr($v,0,2) == "%u")
        $ar[$k] = iconv("UCS-2","GB2312",pack("H4",substr($v,-4)));
      elseif(substr($v,0,3) == "")
        $ar[$k] = iconv("UCS-2","GB2312",pack("H4",substr($v,3,-1)));
      elseif(substr($v,0,2) == "&#") {
    echo substr($v,2,-1)."<br>";
        $ar[$k] = iconv("UCS-2","GB2312",pack("n",substr($v,2,-1)));
      }
    }
    return join(" ",$ar);
    }
    //下面是轉(zhuǎn)換功能
    $db = mysql_connect("localhost", "dbname", "password");
    mysql_select_db("dbname",$db);
    $result = mysql_query("SELECT * FROM dede_archives",$db);
    if ($result === false) die("failed");
    while ($fields = mysql_fetch_row($result)) {
            $con=$fields[10];
            $con = iconv("UTF-8","GB2312",$con);//主要是iconv函數(shù)的使用
            $update="update dede_archives set title='".$con."' where ID=".$fields[0];
            //echo $update;
            mysql_query($update);
            echo $fields[0]."OK"."<br />";
    }
    ?>

    posted @ 2007-04-16 19:38 吳濤濤 閱讀(1628) | 評(píng)論 (0)編輯 收藏

    最近在研究CMS,在數(shù)據(jù)轉(zhuǎn)換的時(shí)候需要用到mysql的replace函數(shù),這里簡單介紹一下!

    比如你要將 表 tb1里面的 f1字段的abc替換為def

    UPDATE tb1 SET f1=REPLACE(f1, 'abc', 'def');

    REPLACE(str,from_str,to_str)   
    在字符串   str   中所有出現(xiàn)的字符串   from_str   均被   to_str替換,然后返回這個(gè)字符串:   
    mysql>   SELECT   REPLACE('www.mysql.com',   'w',   'Ww'); 
                      ->   'WwWwWw.mysql.com' 
    這個(gè)函數(shù)是多字節(jié)安全的。

    示例:
    UPDATE  `dede_addonarticle`  SET body =  REPLACE ( body,
     '</td>',
     '' );
    UPDATE  `dede_addonarticle`  SET body =  REPLACE ( body,
     '</tr>',
     '' );
    UPDATE  `dede_addonarticle`  SET body =  REPLACE ( body,
     '<tr>',
     '' );      
    UPDATE  `dede_archives`  SET title=  REPLACE ( title,
     '大洋新聞 - ',
     '' ); 
    UPDATE  `dede_addonarticle`  SET body =  REPLACE ( body,
     '../../../../../../',
     'http://special.dayoo.com/meal/' );

    mysql replace

    用法1.replace intoreplace into table (id,name) values(‘1‘,‘aa‘),(‘2‘,‘bb‘)
    此語句的作用是向表table中插入兩條記錄。
    2.replace(object, search,replace)
    把object中出現(xiàn)search的全部替換為replaceselect replace(‘www.163.com‘,‘w‘,‘Ww‘)--->WwW wWw.163.com

    例:把表table中的name字段中的 aa替換為bbupdate table set name=replace(name,‘aa‘,‘bb‘)

    posted @ 2007-04-13 16:03 吳濤濤 閱讀(81099) | 評(píng)論 (6)編輯 收藏

    主站蜘蛛池模板: 免费看美女被靠到爽| 亚洲一区二区三区在线网站| 女人与禽交视频免费看| 大地资源中文在线观看免费版| 亚洲精品无码久久久久久| 亚洲尹人九九大色香蕉网站| 国产国拍亚洲精品福利| 午夜色a大片在线观看免费| 最近最好最新2019中文字幕免费| 久久久受www免费人成| 免费的黄网站男人的天堂| 亚洲欧美日韩综合久久久久| 亚洲免费观看网站| 99久久精品国产亚洲| 亚洲AV无码久久精品成人| 国产AV无码专区亚洲AWWW| 一区国严二区亚洲三区| 免费a级毛片在线观看| 暖暖免费高清日本一区二区三区| 综合在线免费视频| 69xx免费观看视频| 8x网站免费入口在线观看| 香港a毛片免费观看| 13小箩利洗澡无码视频网站免费| 久久九九久精品国产免费直播| 免费一区二区无码视频在线播放 | 一级做a爰黑人又硬又粗免费看51社区国产精品视 | 免费一级毛片在线观看| 日本午夜免费福利视频| 午夜男人一级毛片免费 | 狼人大香伊蕉国产WWW亚洲| 亚洲老熟女五十路老熟女bbw| 色天使亚洲综合在线观看| 精品亚洲国产成人| 最新国产成人亚洲精品影院| 亚洲中文字幕无码一去台湾 | 毛片a级毛片免费播放下载| 18禁超污无遮挡无码免费网站国产 | 亚洲免费在线视频观看| 日韩免费精品视频| 成人毛片免费在线观看|