PHP資料提交思想

2021-08-22 17:24:51 字數 409 閱讀 1079

上次說過表單提交簡單獲取方法.後來想想.原來sql語句也可以簡化.

if(!emptyempty($_post))

mysql_connect("localhost","root","");

mysql_select_db("tryease");

mysql_query("insert into `table` (".substr($sql, 0, -1).")values(".substr($value, 0, -1).")");

echo "insert into `table` (".substr($sql, 0, -1).")values(".substr($value, 0, -1).")";

} 要保持表單名和資料庫中的欄位名一到,再有就是注意表單的安全問題.

跟據個人而定.

php模擬post提交資料

php模擬post提交資料,用處很多,可用來 的採集,登陸等等。以程式登陸乙個論壇登入為例 php post資料的三種方法 php有三種方法可以post資料,分別為curl socket file get contents socket版本 使用方法 request by socket facebo...

簡化PHP資料提交的方法

php資料提交的方法很多,普通的方法是通過html頁上面的文字框名稱來post到後台php程式中進行資料庫的增加 刪除 更新操作。這裡提供另外一種可以復用的方法與思路,下面以sqlite資料庫為基礎做個 示範 require once sqlite.php 載入資料庫類 if isset get u...

php使用curl提交獲取資料

用了多次curl後整合出來的,支援多種操作 url arrip 如果有 ip 格式array curlpost 需要post提交資料 header header資料 user agent 模擬瀏覽器訪問 public function curl url,curlpost false,header f...