顯示具有 網頁程式設計 標籤的文章。 顯示所有文章
顯示具有 網頁程式設計 標籤的文章。 顯示所有文章

2011年7月28日 星期四

PHP, 將 JSP 網頁轉址為 PHP



<!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>

 var url=window.location.toString();

    url = url.replace(".jsp", ".php");

 document.location.href = url;

</script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title></title>

</head>

<body>

</body>

</html>

2011年7月1日 星期五

CSS, Excel 凍結視窗



透過CSS設定,達到類似Excel凍結視窗的效果(固定上面、左邊表頭)

http://www.dotblogs.com.tw/topcat/archive/2009/01/09/6702.aspx

不過這是 asp。在 php 下面試了一下,仿照一樣的 css,無效。



类似excel那样冻结(固定)网页表格Table上部的标题行和左侧的某几列

http://s.yanghao.org/program/viewdetail.php?i=90016

太完全了!從文章裡直接複製下來就可以!

2011年1月22日 星期六

網頁編碼



















apache
AddDefaultCharset UTF-8
html
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
php:
1.<?php

header('Content-type: text/html; charset=utf-8');

?>
2.<?php

$new_str = iconv("BIG5", "UTF-8", $old_str);  //big5轉utf8

$new_str = iconv("UTF-8", "BIG5", $old_str); //utf85轉big5

?>
3.<?php

//mysql

mysql_query("SET NAMES 'utf8'");

?>
4.<?php

//sqlsrv(MSSQL)

$connectionInfo = array( "UID"=>"帳號", "PWD"=>"密碼", "Database"=>"資料庫名稱","CharacterSet" => "UTF-8");

?>
5.<?php

//sqlsrv(MSSQL)

while(sqlsrv_fetch($stmt)){

    echo sqlsrv_get_field($stmt, 0, SQLSRV_PHPTYPE_STRING("UTF-8"))."</br>";

?>