進入MySQL Command Line Client環境,
使用root登入mysql:
輸入密碼

 

建立新的資料庫:
CREATE DATABASE newdbname;

 

選擇mysql這個DB:
mysql> USE mysql;

 

下面2個擇一選擇使用。

kinomelma 發表在 痞客邦 留言(0) 人氣()

Javascript中

function IsChinese(date) {//jwu 2015/05/27
var regex = /[\u4e00-\u9fa5]{1,}/;
return regex.test(date);
}

if(IsChinese('陳雷')){
alert("正確中文!!");
return false;
}else{
alert("no");
return false;
}

kinomelma 發表在 痞客邦 留言(0) 人氣()

 

<script type='text/javascript' src='//code.jquery.com/jquery-1.11.0.js'></script>

<link rel="stylesheet" type="text/css" href="/css/result-light.css">

<script type='text/javascript'>
$(function(){
//2015/07/20 jwu
$("#show_other").hide();//先隱藏,等到選到其他後再打開
$("#provider_id").change(function(){
//if ($(this).val()=='[other]'){
// $("#show_other").show();
//}else{
// $("#show_other").hide();

kinomelma 發表在 痞客邦 留言(0) 人氣()


<!DOCTYPE html>
<html lang="zh-TW">
<head>
<title>RWD範例</title>
<!-- -->
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >

<link rel="stylesheet" type="text/css" href="xxx.css" />
<script type="text/javascript">
<!--

//-->
</script>

kinomelma 發表在 痞客邦 留言(0) 人氣()

 

index.htm

<script type="text/javascript" src="/js/plugins/jQuery/ColorBox/jquery.colorbox.js"></script>

<script type="text/javascript">

$(document).ready(function(){

    $(".iframe").colorbox({iframe:true, width:"80%", height:"80%" });

});

</script>

<input type="text" id="member_id" name="member_id" size="20" disabled="disabled">
<a class='iframe' href="value.html">選擇</a>

 


 

kinomelma 發表在 痞客邦 留言(0) 人氣()

-------------
form.html
-------------

<script type="text/javascript">
function del(id){
$.post( "/del", { id: id }, function(data){
        var obj = jQuery.parseJSON( data );
        if(obj.state=='y'){
                alert('刪除完成');
                location.reload();
        }else if(obj.state=='s'){
                alert('無法刪除,該底下尚有子資料');
        }else{
                alert('刪除失敗');
        }
});
}
</script>

<input type="button" name="button4" value="刪除" onclick="del('100')">

-------------
php
-------------
<?php

$json_res = array('error' => 0, 'state' => '', 'mes' => '');

$json_res['state'] = 'y';
$json_res['mes'] = 'x';
die(json_encode($json_res));

?>


kinomelma 發表在 痞客邦 留言(0) 人氣()


<?php
// 西元年轉民國年
$taiwan_date = date('Y')-1911;
//$taiwan_date = sprintf("%04d", $taiwan_date);

$value = str_pad($taiwan_date,4,'0',STR_PAD_LEFT);//將數字由左邊補零至4位數
echo $value;


文章標籤

kinomelma 發表在 痞客邦 留言(0) 人氣()

將smarty寫入目錄所有權改成nginx

chown nginx:nginx /usr/share/nginx/html/web/templates_c

 

 


文章標籤

kinomelma 發表在 痞客邦 留言(0) 人氣()

壓縮

#進入/tmp目錄
cd /tmp 

#把/tmp目錄下面的alldata目錄壓縮為test.zip
zip -r test.zip alldata #壓縮tmp目錄

解壓縮

#進入/tmp目錄
cd /tmp 

#把/tmp目录下面的test.zip直接解压到/tmp目录里面
unzip test.zip

 

kinomelma 發表在 痞客邦 留言(0) 人氣()

當登入openwebmail (http://127.0.0.1/webmail)

出現Couldn't write /var/log/openwebmail.log! (Permission denied)

表示權限被拒絕啦!

 

執行以下:

touch /var/log/openwebmail.log
chcon -u system_u /var/log/openwebmail.log
chcon -t httpd_sys_script_rw_t /var/log/openwebmail.log
chcon -t httpd_unconfined_script_exec_t /var/www/cgi-bin/openwebmail/openwebmail*

說明
touch /var/log/openwebmail.log #產生日誌文件
chcon -u system_u /var/log/openwebmail.log #修改文件權限

kinomelma 發表在 痞客邦 留言(0) 人氣()