<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月23日

    <!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 吳濤濤 閱讀(391) | 評論 (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 吳濤濤 閱讀(441) | 評論 (0)編輯 收藏

    2007年4月16日

    <?
    //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 吳濤濤 閱讀(1621) | 評論 (0)編輯 收藏

    2007年4月13日

    最近在研究CMS,在數(shù)據(jù)轉(zhuǎn)換的時候需要用到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替換,然后返回這個字符串:   
    mysql>   SELECT   REPLACE('www.mysql.com',   'w',   'Ww'); 
                      ->   'WwWwWw.mysql.com' 
    這個函數(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 吳濤濤 閱讀(81087) | 評論 (6)編輯 收藏

    2007年3月29日

    1、環(huán)境說明:
    WINDOWS2003、JDK 1.5.0_11、ANT 1.6.5、Tomcat 5.0.27、MySQL4.1.10a;
    先設(shè)置好環(huán)境變量;

    2、數(shù)據(jù)庫設(shè)置
    #database.jar=${mysql.jar}
    #database.jar.name=${mysql.jar.name}
    #database.dir=${mysql.dir}
    #database.version=${mysql.version}
    #database.type=mysql
    #database.name=${webapp.name}_db
    #database.host=localhost
    #database.port=3306
    #database.driver_class=com.mysql.jdbc.Driver
    #database.url=jdbc:${database.type}://${database.host}:${database.port}/${database.name}?characterEncoding=utf-8&amp;useUnicode=true&amp;autoReconnect=true
    #database.username=test
    #database.password=test
    #hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect


    改為:
    database.jar=${mysql.jar}
    database.jar.name=${mysql.jar.name}
    database.dir=${mysql.dir}
    database.version=${mysql.version}
    database.type=mysql
    database.name=${webapp.name}_db
    database.host=localhost
    database.port=3306
    database.driver_class=com.mysql.jdbc.Driver
    database.url=jdbc:${database.type}://${database.host}:${database.port}/${database.name}?characterEncoding=utf-8&amp;useUnicode=true&amp;autoReconnect=true
    database.username=數(shù)據(jù)庫用戶名
    database.password=數(shù)據(jù)庫密碼
    hibernate.dialect=org.hibernate.dialect.MySQLDialect

    在數(shù)據(jù)庫初始化的過程中,提示${hibernate.transaction.factory_class},我就在properties.xml中將
    <entry key="hibernate.transaction.factory_class" value="${hibernate.transaction.factory_class}"/>

    改為
    <entry key="hibernate.transaction.factory_class" value="org.hibernate.transaction.JDBCTransactionFactory"/>

    就可以通過;


    3、服務(wù)器設(shè)置
    1)
    # Jetty is embeded into AtLeap distribitive
    appserver.type=jetty5
    appserver.http.port=8080
    # in order to enable support HTTPS please reconfigure jettyplus.xml
    appserver.https.port=8443
    # the memory sizes
    jetty.initialmemory=128m
    jetty.maxmemory=256m

    改為:
    # Jetty is embeded into AtLeap distribitive
    # appserver.type=jetty5
    # appserver.http.port=8080
    # in order to enable support HTTPS please reconfigure jettyplus.xml
    # appserver.https.port=8443
    # the memory sizes
    # # jetty.initialmemory=128m
    jetty.maxmemory=256m

    2)
    # Please specify tomcat5 or tomcat5.5
    #appserver.type=tomcat5.5
    #appserver.http.port=8080
    #appserver.https.port=8443

    #tomcat.manager.host=${appserver.host}
    #tomcat.manager.port=${appserver.http.port}
    #tomcat.manager.url=http://${tomcat.manager.host}:${tomcat.manager.port}/manager
    #tomcat.manager.username=manager
    #tomcat.manager.password=manager

    改為:
    # Please specify tomcat5 or tomcat5.5
    appserver.type=tomcat
    appserver.http.port=8080
    appserver.https.port=8443

    tomcat.manager.host=${appserver.host}
    tomcat.manager.port=${appserver.http.port}
    tomcat.manager.url=http://${tomcat.manager.host}:${tomcat.manager.port}/manager
    tomcat.manager.username=manager
    tomcat.manager.password=manager

    4、部署設(shè)置
    # Usually you do not need to specify below properties
    #tomcat.home=C:/TOOLS/java/jakarta-tomcat-5.5.7
    #tomcat.app.base=${tomcat.home}/webapps
    #tomcat.service.name=Catalina
    #tomcat.work.dir=${tomcat.home}/work/${tomcat.service.name}/${appserver.host}/${context.doc.base}
    #tomcat.conf.dir=${tomcat.home}/conf/${tomcat.service.name}/${appserver.host}

    改為:

    # Usually you do not need to specify below properties
    tomcat.home=c:/tomcat
    tomcat.app.base=${tomcat.home}/webapps
    tomcat.service.name=Catalina
    tomcat.work.dir=${tomcat.home}/work/${tomcat.service.name}/${appserver.host}/${context.doc.base}
    tomcat.conf.dir=${tomcat.home}/conf/${tomcat.service.name}/${appserver.host}

    回到build.xml所在的目錄,執(zhí)行ant deploy;

    5、測試運(yùn)行
    http://localhost:8080/atleap

    參考文檔:Blandware AtLeap 安裝說明

    posted @ 2007-03-29 19:46 吳濤濤 閱讀(543) | 評論 (0)編輯 收藏

    AtLeap是一個基于AppFuse的CMS,最新版本是0.52,按官方說直接運(yùn)行就可以,還是花了點(diǎn)時間;用了其內(nèi)置的服務(wù)器jetty;開始時以為是jvm的問題,改為1.4.2,問題還是一樣;仔細(xì)看了出錯信息后,增加一個ANT_OPTS環(huán)境變量后,再運(yùn)行就可以通過了。

    有朋友說配置Mysql運(yùn)行比較容易,還沒有嘗試;

    AtLeap支持多語言,聽說還獲得了不少獎,應(yīng)該是一個不錯的CMS,有空好好看看。

    posted @ 2007-03-29 18:23 吳濤濤 閱讀(607) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 亚洲av无码国产精品色午夜字幕 | 亚洲ts人妖网站| 免费无码又爽又刺激聊天APP| 亚洲乱妇熟女爽到高潮的片| 免费人成网站在线高清| 国产婷婷成人久久Av免费高清| 精品亚洲麻豆1区2区3区| 成人毛片免费观看| 国产97视频人人做人人爱免费| 亚洲网站视频在线观看| 在线观看永久免费视频网站| 色www永久免费网站| 激情内射亚洲一区二区三区爱妻| 免费国产怡红院在线观看| 久久青草免费91线频观看站街| 亚洲kkk4444在线观看| 亚洲无码高清在线观看| av无码免费一区二区三区| 国产精品亚洲а∨无码播放不卡| 亚洲国产精华液网站w| 夫妻免费无码V看片| 久久免费高清视频| 亚洲AV无码片一区二区三区| 亚洲三级电影网址| 亚洲成人高清在线| 免费在线看v网址| 一级做a爰片久久毛片免费陪 | 中文字字幕在线高清免费电影| 久久久久se色偷偷亚洲精品av| 中文亚洲成a人片在线观看| 最近中文字幕无免费视频| a级毛片毛片免费观看永久| 亚洲AV成人一区二区三区在线看 | 成年女人18级毛片毛片免费 | 亚洲AV无码乱码在线观看富二代 | 亚洲无砖砖区免费| 亚洲综合伊人制服丝袜美腿| 久久精品国产亚洲Aⅴ香蕉| 黄瓜视频影院在线观看免费| 高h视频在线免费观看| 亚洲伊人久久大香线蕉|