IE
.xxx{
filter:Alpha(opacity=50);
}
FireFox
.xxx{
opacity:0.5;
}
在PHP中取得目前檔案的檔名
取得目前檔名和副檔名
例如test.php會印出test.php
print basename($_SERVER['PHP_SELF']);
取得目前檔名
例如test.php會印出test
print substr(basename($_SERVER['PHP_SELF']),0,-4);
例如test.php會印出test.php
print basename($_SERVER['PHP_SELF']);
取得目前檔名
例如test.php會印出test
print substr(basename($_SERVER['PHP_SELF']),0,-4);
java中輸入變數的方法
import java.util.*;
public class aaa {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Object i = sc.next();
System.out.println("i is "+ i);
}
}
public class aaa {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Object i = sc.next();
System.out.println("i is "+ i);
}
}
使用prototype AJAX 的post方法~
Javascript 的部份
表單部份
print $HTTP_POST_VARS['name'];
?>
<script type="text/javascript">
function postNewContact(){
var form = $('form');
var name = $('name');
var url = 'xxx.php';
var myAjax = new Ajax.Request(url,{method:'post',
parameters: Form.serialize(form),
onComplete:showResponse});
}
function showResponse(originalRequest){
alert(originalRequest.responseText);
}
</script>
表單部份
<form method="post" id="form" name="form">
<input type="text" name="name">
</form>
xxx.php檔案
<?print $HTTP_POST_VARS['name'];
?>
PHP中讀取目錄所有檔案及資料夾
$location = "./";
$dir = opendir($location);
while($entry = readdir($dir)){
print $entry.' ';
}
$dir = opendir($location);
while($entry = readdir($dir)){
print $entry.' ';
}
如何在PHP顯示所有資料庫清單
$link = mysql_connect(HOST, USERNAME , PASSWORD)
$db_list = mysql_list_dbs($link);
while($rows = mysql_fetch_object($db_list)){
print $rows->Database." ";
}
$db_list = mysql_list_dbs($link);
while($rows = mysql_fetch_object($db_list)){
print $rows->Database." ";
}
PHP中陣列的key & value用法
while (list($key, $value) = each( ARRAY)) {
echo "Key = ".$key." , Value = ".$value;
}