注冊頁面:reg.html

站在用戶的角度思考問題,與客戶深入溝通,找到瓦房店網(wǎng)站設(shè)計與瓦房店網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設(shè)計與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:成都網(wǎng)站制作、成都做網(wǎng)站、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣、域名注冊、網(wǎng)頁空間、企業(yè)郵箱。業(yè)務(wù)覆蓋瓦房店地區(qū)。
form action="reg.php" method="POST"
table
trtd用戶名:/tdtdinput type="username" size="20"/td/tr
trtd密碼:/tdtdinput type="userpass" size="20"/td/tr
trtd確認密碼:/tdtdinput type="ruserpass" size="20"/td/tr
trtd郵箱:/tdtdinput type="email" size="50"/td/tr
trtd電話:/tdtdinput type="telphone" size="20"/td/tr
trtdinput type="Submit" value="注冊"/td/tr
/table
/form
接收頁面:reg.php
%php
$db = mysql_connect("localhost", "root", "12345");
mysql_select_db("dataname", $db);
mysql_query("insert into tablename(username, userpass, email, telphone) values('$_POST[username]', '$_POST[userpass]', '$_POST[email]', '$_POST[telphone]')");
echo "注冊成功";
%
傳統(tǒng)方法是用 form標(biāo)簽 將輸入的數(shù)據(jù) 提交到后臺的php, 由php獲得數(shù)據(jù)后寫入數(shù)據(jù)庫, 下面SubMsg.php 就是用來處理的后臺
form name="MsgForm" method="post" action="SubMsg.php" onsubmit="return CheckForm();"label for='jqshul'機器數(shù)量/labelinput name="jqshul" type="text" class="InputBorder" id="jqshul" size="66" input type="submit" name="Submit" value="預(yù)定" /form
后臺 SubMsg.php
? if (!isset($jqshul)){ echo "機器數(shù)量不存在," return;} echo $jqshul;//這個變量就是從前臺接收的機器數(shù)量. 字段的name 是什么就寫什么// 如何寫入數(shù)據(jù)庫, 要看用什么數(shù)據(jù)庫了 要配置數(shù)據(jù)庫不是一兩句能說清的了//大致流程 是配置數(shù)據(jù)庫 打開數(shù)據(jù)連接 根據(jù)變量生成SQL語句 執(zhí)行語句?
首先你要建立一個表,例如是注冊的用戶表user
,里面的結(jié)構(gòu)有字段
id,
name,nickname,email等。
然后在你的表單處form
action="a.php"
method="post"
name="regform"(如果有圖片上傳,還要加上enctype="multipart/form-data")
,那么點擊表單提交按紐后,此表單將會交給處理頁a.php來作處理。
如果簡單點,你就直接可以將表單傳遞過來的數(shù)據(jù)$_POST,直接用sql插入語句,insert
into來插入到數(shù)據(jù)庫,表user中。例如insert
into
user
set
name='".$_POST['name']."'.............................
分享題目:php注冊成功寫入數(shù)據(jù)庫 php登錄注冊數(shù)據(jù)庫
URL分享:http://chinadenli.net/article8/ddodhip.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、建站公司、定制開發(fā)、定制網(wǎng)站、網(wǎng)站設(shè)計公司、網(wǎng)頁設(shè)計公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)