在Nginx服务器中设置多个站点
2017-02-08 17:06:57
当我们有了一个 VPS 主机以后,为了不浪费 VPS 的强大资源(相比共享主机1000多个站点挤在一台机器上),往往有想让 VPS 做点什么的想法,银子不能白花啊:)。放置多个网站或者博客是个不错的想法,可是如何配置 web 服务器才能在一个 VPS 上放置多个网站/博客呢?如何通过一个 IP 访问多个站点/域名呢?这就是大多数 web 服务器支持的 virtual hosting 功能。这里将描述如何一步一步如何用 nginx 配置 virtual hosting。 nginx 是一个小巧高效的 web 服务器,由俄罗斯程序员 Igor Sysoev 开发,nginx 虽然体积小,但功能一点也不弱,能和其他的 web 服务器一样支持 virtual hosting,即一个IP对应多个域名以支持多站点访问,就像一个IP对应一个站点一样,所以是”虚拟”的。你想在...
插入排序法
2017-02-08 11:30:38
插入排序法: 就是采用数组中的数值,,分别进行比较,,两个数值比较完后,,大的放后面, 小的放前面,,两个互换位置, function insert_sort($array){ if (count($array) <= 1) return $array; for ($i=1;$i<count($array);$i++) { $temp = $array[$i]; $j = $i-1; &...
XML生成方法
2017-02-08 11:29:41
通过构造数组。再执行生成函数即可 $data=array( 'config'=>array( 'list'=>array( 'tollgate_id'=>'tollgate_id', 'tollgate_name'=>'tollgate_name', 'tollgate_life'=>'tollgate_life...
xml生成
2017-02-08 11:29:19
方法一: <?php $dom = new DOMDocument('1.0', 'iso-8859-1'); $element = $dom->createElement('test', 'This is the root element!'); // We insert the new element as root (child of the document) $dom->appendChild($element); echo $dom->saveXML(); ?> 方法二: $DOM = new DOMdocument('1.0', 'utf-8'); $node ...
smtp发送邮件
2017-02-08 11:28:53
使用PHPMAIL类库 require("../tabs/inc/mail/class.phpmailer.php"); $mail = new PHPMailer(true); //$address = 'magnetech@vip.163.com'; $address = 'linzhimao001@gmail.com';//要发送的地址 $mail->IsSMTP(); // set mailer to use SMTP $mail->Port = 25; &...
PHP实现简单分页实例
2017-02-07 21:33:00
PHP实现简单分页实例 2009年09月20日 星期日 23:45 显示分页数据页面 index.php 文件代码: <?php include("conn/conn.php"); if ($page=="") {$page=1;};if ($ljjl=="") {$ljjl=0;};?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>查询结果的分页显示</title> <style type="text/css"> <!--...
jquery的一些用法
2017-02-07 21:32:09
1.想要触发某些事件的话,只要把相应的事件写入到 $(document).ready(function() { // do stuff when DOM is ready }); 中,例如 $(document).ready(function() { $("a").click(function() { alert("Hello world!"); }); });其中的a是指链接,click相当于静态的onclick功能,在jquery中都把on去掉了 这里click里面接一个function就是我们要编辑的事件 2.jQuery提供两种方式来选择html的elements,第一种是用CSS和Xpath选择器联合起来形成一个字符串来传送到jQuery的构造器(如:$(...
fck中文乱码
2017-02-07 21:31:26
1、修正上传中文文件时文件名乱码问题 在文件fckeditor/editor/filemanager/connectors/php/commands.php中查找: $sFileName = $oFile['name'] ; 在后面添加一行: $sFileName = iconv("utf-8","gbk",$sFileName); 2、修正文件列表时中文文件名显示乱码问题 在文件fckeditor/editor/filemanager/connectors/php/util.php中查找: return ( utf8_encode( htmlspecialchars( $value ) ) ) ; 修改为: return iconv('','utf-8',htmlspecialc...
fck使用
2017-02-07 21:30:27
<!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> </head> <script type="text/jav...
EMAIL AJAX验证
2017-02-07 21:29:50
// function check_email(){ // // if (!document.getElementById("username").value.match(/^[a-z0-9][w.-_]+@w+(.w+){1,3}$/i)) { // document.getElementById("error_username").innerHTML = "EMAIL is not valid!"; // return false //  ...