首先登陸要用用戶名,密碼等等信息,這些都要存在數(shù)據(jù)庫(kù)中,這樣才能用戶登陸時(shí)驗(yàn)證是否能夠登陸,
秀洲網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián),秀洲網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為秀洲1000多家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站制作要多少錢,請(qǐng)找那個(gè)售后服務(wù)好的秀洲做網(wǎng)站的公司定做!
1.創(chuàng)建一個(gè)數(shù)據(jù)庫(kù),建表例表一(用戶名,密碼)等等。。
1.設(shè)計(jì)頁(yè)面代碼包含連接數(shù)據(jù)庫(kù),數(shù)據(jù)庫(kù)操作代碼等等(加入用戶,刪除用戶。。)
2.代碼中包含用戶登陸輸入
用戶名,密碼
3.打開數(shù)據(jù)庫(kù)表,查找是否有該用戶名,如果存在,密碼是否正確,不正確byebye
(請(qǐng)看java書本
數(shù)據(jù)庫(kù)內(nèi)容,包含建立數(shù)據(jù)庫(kù),添加刪除基本操作)
search.html //前臺(tái)網(wǎng)頁(yè)編寫
html
head
meta http-equiv="Content-Type"content="text/html;charset=gb2312"
title搜索/title
/head
body
form name="form" action="search.php" method="post"
input type="text" name="search_text" size="20"
input type="submit" value="搜索"
/form
/body
/html
search.php//后臺(tái)處理文件
?php
$word=$_POST["search_text"];
$link=mysql_connect("localhost","root","password") or die("無(wú)法連接");
//localhost、root和password需要根據(jù)自己的實(shí)際情況來(lái)使用。
$db_selected=mysql_select_db("db_keywords",$link);
//db_keywords為要打開的數(shù)據(jù)庫(kù)。
$sql="select * from keywords where word like '%$word%' order by count desc";
//keywords為要打開查詢的表
$result=mysql_query($sql,$link);
while($row=mysql_fetch_row($result))
{
for($i=0;$imysql_num_fields($result);$i++)
echo "$row[$i]"." ";
echo "br";
}
?
這是最簡(jiǎn)單也是具有最基本功能的搜索頁(yè)面,其他的需要自己修改和處理了。
希望對(duì)你有所幫助。
$db = mysql_connect("localhost", "root", "password");
mysql_select_db("mydb",$db);
if (isset($_POST['name'])) {
echo "你輸入的用戶是:". $_POST['name'];
}
$result = mysql_query("SELECT * FROM employees WHERE name='".$_POST['name']."'",$db);
while ($fields = mysql_fetch_row($result)) {
$data[] = $filelds;
}
if(!empty($data)){
foreach($data as $val){
foreach($val as $k = $v){
echo $k." ".$v."br /";
}
echo "br /hr /";
}
}else{
echo "此用戶下沒(méi)有數(shù)據(jù)。";
}
可能需要修改的地方,查詢條件我是使用的name,根據(jù)你數(shù)據(jù)庫(kù)中的字段名做一下更改,輸出信息沒(méi)有太多的處理,可以使用表格輸出或是其它樣式,可以自己調(diào)整一下,HTML部分省略了。
這個(gè)簡(jiǎn)單?。?/p>
首頁(yè)做個(gè)前臺(tái)輸入姓名和會(huì)員卡信息的頁(yè)面,我做個(gè)簡(jiǎn)單的頁(yè)面給你看
!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"
html?xmlns="
head
meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/
title會(huì)員查詢系統(tǒng)/title
/head
body
form?id="form1"?name="form1"?method="post"?action="test.php"
p
label?for="name"/label
input?type="text"?name="name"?id="name"?/
/p
p
label?for="vipid"/label
input?type="text"?name="vipid"?id="vipid"?/
/p
p
input?type="submit"?name="button"?id="button"?value="查詢"?/
/p
/form
/body
/html
然后我給你一個(gè)test.php的文件代碼:
?php
$name????=????trim($_POST['name']);
$vipid????=????trim($_POST['vipid']);
$con?=?mysql_connect("127.0.0.1","數(shù)據(jù)庫(kù)用戶名","數(shù)據(jù)庫(kù)密碼");
if?(!$con)
{
die('Could?not?connect:?'?.?mysql_error());
}
$a????=????mysql_select_db("數(shù)據(jù)庫(kù)名字",?$con);
$sql????=????"select?*?from?kh_customer?where?name?=?'$name'?and?vipid?=?'$vipid'";
$result?=?mysql_query($sql);
while($row?=?mysql_fetch_array($result))
{
echo?$row['name']?.?"?"?.?$row['data'];
echo?"br?/";
}
mysql_close($con);
?
頁(yè)面美化自己去搞!只能幫你這么多了
兩個(gè)頁(yè)面即可實(shí)現(xiàn),html頁(yè)面寫一個(gè)ajax例如:
script
var k=$("#kk").val();//獲取用戶輸入的查找內(nèi)容
$.ajax({
type:'get',
url:'xx.php',
data:'keyword='+i,
success:function(data){
var data1=eval("("+data+")") ;
if(data1){
$('#main').html(data1);//顯示結(jié)果
}
},
});
/script
xx.php:
if($_GET){
$key=isset($_GET['keyword'])?$_GET['keyword']:'';
if($key){
//連接數(shù)據(jù)庫(kù)通過(guò)關(guān)鍵詞查找相關(guān)內(nèi)容..$content
//結(jié)果返回: echo json_encode($content);
exit();
}else{
echo json_encode('');
exit();
}
}
對(duì)了,html頁(yè)面要引入jquery插件
當(dāng)前名稱:php數(shù)據(jù)查詢界面 php數(shù)據(jù)庫(kù)查詢系統(tǒng)
分享鏈接:http://muchs.cn/article36/docccsg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供云服務(wù)器、搜索引擎優(yōu)化、動(dòng)態(tài)網(wǎng)站、服務(wù)器托管、面包屑導(dǎo)航、手機(jī)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)