php导入SQL文件
<?php
$host = “localhost”;
$user = “root”;
$pwd = “”;
$file_dir = dirname(__FILE__);
$file_name = “del.sql”;
$data_base = “test”; 阅读全文
PHP中文网,因为专业所以权威!
<?php
$host = “localhost”;
$user = “root”;
$pwd = “”;
$file_dir = dirname(__FILE__);
$file_name = “del.sql”;
$data_base = “test”; 阅读全文
<!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>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title></title>
<script type=”text/javascript” src=”js/jquery-1.2.6.min.js”></script>
<style type=”text/css”>
#testtable{ border-collapse:collapse;width:200px;table-layout:fixed;margin-top:20px;}
#testtable td{border:1px solid #ccc; height:20px;font-size:11px;}
</style>
</head> 阅读全文
jquery radio取值,checkbox取值,select取值,radio选中,
var item = $(’input[@name=items][@checked]‘).val();
获取select被选中项的文本
var item = $(”select[@name=items] option[@selected]“).text();
select下拉框的第二个元素为当前选中值
$(’#select_id’)[0].selectedIndex = 1;
radio单选组的第二个元素为当前选中值 阅读全文
js标签只有onload\onunload\onbeforeunload事件,而没有onclose事件。不管页面是关闭还是刷新都会执行onunload事件。如何捕捉到页面关闭呢?
页面加载时只执行onload
页面关闭时只执行onunload
页面刷新时先执行onbeforeunload,然后onunload,最后onload。这样我们可以在onbeforeunload中加一个标记,在onunload中判断该标记,即可达到判断页面是否真的关闭了。 阅读全文
Onunload,onbeforeunload都是在刷新或关闭时调用,可以在<script>脚本中通过window.onunload来指定或者在<body>里指定。
区别在于onbeforeunload在onunload之前执行,它还可以阻止onunload的执行。
Onbeforeunload也是在页面刷新或关闭时调用,Onbeforeunload是正要去服务器读取新的页面时调用,此时还没开始读取;而onunload则已经从服务器上读到了需要加载的新的页面,在即将替换掉当前页面时调用。Onunload是无法阻止页面的更新和关闭的。而 Onbeforeunload 可以做到。 阅读全文
PHP提供register_shutdown_function()这个函数,能够在脚本终止前回调注册的函数
register_shutdown_function例子代码:
以下为引用的内容: 阅读全文
代码高亮插件-SyntaxHighlighter,安装了好几次都不好用!readme只有简单的语法没有配置,就去google上,最终找到了个配置方法,现在转载过来,做个记录!
SyntaxHighlighter支持的语法
C# — c#、c-sharp、csharp
CSS — css
Delphi — delphi、pascal
Java — java
JavaScript — js、jscript、javascript
PHP — php
Python — py、python
Ruby — rb、ruby、rails、ror
SQL — sql
VB — vb、vb.net
XML/HTML — xml、html、xhtml、xslt 阅读全文