php 接收表單傳輸過的資料的兩種方法

2021-04-12 12:03:17 字數 777 閱讀 4310

1、

$name = $_post["name"] ;

$email = $_post["email"] ;

$title = $_post["title"] ;

$content = $_post["content"] ;

$id = @mysql_connect("localhost","root","");

mysql_select_db("zhujbing",$id);

echo $id."

";$query = "insert into zjb (name,email,title,content) values ($name,$email,$title,$content)";

$result=mysql_query($query)or die("query error");

mysql_close($id);

2、import_request_variables("gpc");

$id = @mysql_connect("localhost","root","");

mysql_select_db("zhujbing",$id);

echo $id."

";$query = "insert into zjb (name,email,title,content) values ($name,$email,$title,$content)";

$result=mysql_query($query)or die("query error");

mysql_close($id);

php 簡單的表單接收

如何利用表單處理實現直接在頁面輸出的效果。1 在php中表單的提交是一種十分重要的資料提交方式。比如登入註冊,購物車等都要用到表單提交。2 下面我們來學習表單處理,將資料在頁面上輸出。首先我們建立一個簡單的表單。3 在form表單中action規定了當提交表單時,向何處傳送表單的資料。action ...

接收表單提交資訊

request.querystring 接收 get 提交方式資訊 request.querystring最大特點是能檢索並接受 http 查詢字串中變數的值,而http 查詢字串則是由問號 後的值指定的 request.querystring yourname yourname 對應於 html ...

表單的提交與接收

開發工具與關鍵技術 visual studio 2015 c 之前我們一起學習的新增與修改都有用到表單,也簡單地講解了表單的提交與接收的方法,這裡呢就是把表單的提交與接收的方法彙總起來,下面我們一起去了解一下吧!from表單是一個承載資料的容器,那麼表單提交呢就是我們需要把表單裡的資料提交到另一個地...

PHP利用超級全域性變數 GET來接收表單資料。

我們在linux上用 touch php get.html php get.php建立兩個檔案。php get.html檔案的 如下 1 doctype html 2 html 3 head 4 title 超級全域性變數 get來接收提交的資料,然後返回資訊 php get.php?subject...

php提交表單處理,PHP表單處理

我們可以在php中建立和使用表單。要獲取表單資料,需要使用php超級元組 get和 post。表單請求可以是get或post。要從get請求中檢索資料,需要使用 get,而 post用於檢索post請求中的資料。php get表單 get請求是表單的預設請求。通過get請求傳遞的資料在url瀏覽器上...