原创 window.location.reload;刷新\indexOf()定義和用法\window.location.href

使用window.location.reload;刷新時,如果提交數據的動作,則會出現討厭的對話框! 解決此問題,應該這樣寫: window.location.href=window.location.href; wi

原创 去掉 URL 中的 index.php

去掉 URL 中的 index.php ThinkPHP 作爲 PHP 框架,是單一入口的,那麼其原始的 URL 便不是那麼友好。但 ThinkPHP 提供了各種機制來 定製需要的 URL 格式,配合 Apache .htacce

原创 文件上傳函數(有空會自己修改)

CODE <?php /** * A function for easily uploading files. This function will automatically generate a new *

原创 檢查字符串中是否有外鏈

<?php /** * all_external_link 檢測字符串是否包含外鏈 * @param string $text 文字 * @param string $host 域名 * @return boole

原创 ajax+php無刷新文件上傳(ajaxuploadfile)

文件上傳的表單格式 <form id="uploadform" enctype="multipart/form-data" name="uploadform" method="post" > <input id=

原创 linux (centos 6.4)安裝自定義分區方案

在計算機上安裝 Linux 系統,對硬盤進行分區是一個非常重要的步驟,下面介紹幾個分區方案。 方案 1 / :建議大小在 5GB 以上。 swap :即交換分區,建議大小是物理內存的 1~2 倍。 方案 2 /boot :用

原创 html中標籤用法解析及如何設置select的默認選中狀態

<select>標籤可選的屬性 屬性 值 描述 disabled disabled 規定禁用該下拉列表。 multiple multiple 規定可選擇多個選項。 name

原创 array get_object_vars

array get_object_vars ( object obj ) 返回由 obj 指定的對象中定義的屬性組成的關聯數組。 <?php class Point2D { var $x, $y; var $label; func

原创 PHP怎麼與C語言通信

hb怎麼與C語言通信?用C語言作爲服務端,用php作爲客戶端。方法如下: /*server.c*/ #include <string.h> #include <stdio.h> #include <netinet/in.h> #

原创 thinkphp 如何去除url中的index.php

使用 thinkphp 開發的應用的 url 中通常都會帶個 index.php ,如果我們 需要僞靜態或者做 SEO 優化的時候,這個是非常不好看也沒有意義的。那麼我們 該如何去除 thinkphp 應用 url 中的 inde

原创 http和https的區別

簡述http和https的區別 在URL前加https://前綴表明是用SSL加密的。 你的電腦與服務器之間收發的信息傳輸將更加安全。 Web服務器啓用SSL需要獲得一個服務器證書並將該證書與要使用SSL的服務器綁定。 http

原创 curl的安裝

window下: 開啓curl的步驟 1.在localhost站點下輸出一下phpinfo,以此來檢測php.ini的所在 (因爲我在開啓CURL的時候,是在php的安裝目錄配置php.ini,結果一直不生 效,後來查了phpin

原创 php發送get、post請求的幾種方法

方法1: 用file_get_contents 以get方式獲取內容 <?php $url='http://www.domain.com/'; $html = file_get_contents($url); echo $html

原创 datagrid自己的一些操作積累

向表格中添加或者刪除一行數據 //添加頁面的表格 $('#tt2').datagrid({ url:'', width: 566, height: 139, fitColumns: true,

原创 json_encode和json_decode的用法

json_decode() json_decode (PHP 5 >= 5.2.0, PECL json >= 1.2.0) json_decode — 對 JSON 格式的字符串進行編碼 說明 mixed j