第一个文件是:login.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户注测页面(登录页面)</title>
</head><body>
<form enctype="multipart/form-data" name="form1" method="post" action="login_action.php">
  <table width="329" height="150" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0000FF">
    <tr>
      <td colspan="2" align="center" bgcolor="#FFFFFF">用户注册</td>
    </tr>
    <tr>
      <td width="82" align="right" bgcolor="#FFFFFF">用户名:</td>
      <td width="244" align="left" bgcolor="#FFFFFF"><input name="user_name" type="text" size="16"></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#FFFFFF">登录口令:</td>
      <td align="left" bgcolor="#FFFFFF"><input name="user_pw1" type="password" size="16"></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#FFFFFF">登录口令:</td>
      <td align="left" bgcolor="#FFFFFF"><input name="user_pw2" type="password" size="16"></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#FFFFFF">头像:</td>
      <td align="left" bgcolor="#FFFFFF"><input type="file" name="pic_name"></td>
    </tr>
    <tr>
      <td colspan="2" align="center" bgcolor="#FFFFFF"><input type="submit" name="Submit" value="注册">&nbsp;&nbsp;
      <input name="Submit2" type="reset" value="重置"></td>
    </tr>
  </table>
</form>
</body>
</html>
第二个文件是:login_action.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户登录</title>
</head><body>
<?php
$user_name=$_POST["user_name"];
$user_pw=$_POST["user_pw"];
$user_name2=$user_name."\n";
$user_pw2=$user_pw."\n";
$tag=0;
$file=@fopen("user_info.txt","r");
if($file){
while(!feof($file)){
$buffer=fgets($file,4096);
if($buffer==$user_name2){
$buffer=fgets($file,4096);
if($buffer==$user_pw2){
echo"你输入的用户名和密码正确,登陆成功!<br>";
$image=fgets($file,4096);
echo"你的头像:<img src=".$image." align=middle><br>";
$tag=1;
break;
}
}
}
if($tag==0){
echo"你输入的用户名和密码不正确,请<a href=lang.html>返回</a>重新输入";
}
fclose($file);
}
?>
</body>
</html>
第三个文件是:land.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户登录</title>
</head><body>
<form action="land_action.php" method="post" name="form1">
<table width="341" height="105" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0000FF">
  <tr align="center" bgcolor="#FFFFFF">
    <td colspan="2">用户登录</td>
  </tr>
  <tr>
    <td width="85" align="right" bgcolor="#FFFFFF">用户名:</td>
    <td width="209" align="left" bgcolor="#FFFFFF"><input name="user_name" type="text" size="16"></td>
  </tr>
  <tr>
    <td align="right" bgcolor="#FFFFFF">登录口令:</td>
    <td align="left" bgcolor="#FFFFFF"><input name="user_pw" type="password" size="16"></td>
  </tr>
  <tr align="center">
    <td colspan="2" bgcolor="#FFFFFF"><input type="submit" name="Submit" value="登录">&nbsp;&nbsp;
    <input name="Submit2" type="reset" value="重置"></td>
  </tr>
</table>
</form>
</body>
</html>
在我的电脑上 运行的时候  老是不能显示头像 请各位 在你们电脑里 运行 一下 试试 谢谢