Home >Backend Development >PHP Tutorial > 怎么实现输入用户名密码后可查询信息并修改

怎么实现输入用户名密码后可查询信息并修改

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 12:45:57979browse

如何实现输入用户名密码后可查询信息并修改
这是我的代码,运行结果如图。如何显示出数据库信息并可以修改某一项。

nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br>
<br>
<br>
<meta><br>
<title>学生信息</title><br>
<br>
<br>
<?php  <br />
//######################学生信息##########################<br>
include "config.php";<br>
include "header.php";<br>
 ?><br>
 <?php <br />
 extract($_POST);<br>
 if ($xuehao=="" ||$password=="") <br>
 {<br>
	echo"<p><font><b><big>请把信息填写完整</big></b></font></p>";<br>
	echo "<meta>";<br>
	exit;	<br>
 }<br>
 else<br>
 {<br>
    $query="select * from $student_table where xuehao='$xuehao'";<br>
	mysql_query("set names 'GB2312'");<br>
	$result=mysql_query($query);<br>
	$row=mysql_fetch_array($result);<br>
	if($row==0)<br>
	{<br>
	 echo"<p><font><b><big>你还没有注册,请先注册。</big></b></font></p>";<br>
	 echo "<meta>";<br>
	 exit;<br>
	   }<br>
	<br>
	<br>
	 $query="select password as sm from $student_table where xuehao='$xuehao'";<br>
	 mysql_query("set names 'GB2312'");<br>
	 $result=mysql_query($query);<br>
	 $row=mysql_fetch_array($result);<br>
	 $num=strlen($row['xuehao']);<br>
	 $xh=$row['xuehao'];<br>
	 $n=0;<br>
	 if($row[sm]!=$password)<br>
	 {<br>
		echo"<p><font><b><big>你输入的学号和密码不匹配,请重新输入。</big></b></font></p>";<br>
		echo "<meta>";<br>
		exit;<br>
	   }<br>
	  <br>
	 }<br>
?><br>
<p><br>
</p>		  <br>
  

  
  
     
      
    
     
      
      
    
 
      
>>>学生信息

        
学号:

      
 "  readonly="readonly">
      

        
姓名:
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn