PHP는 공개 웹페이지를 생...로그인

PHP는 공개 웹페이지를 생성하기 위한 간단한 도서 대출 시스템을 개발합니다.

저희 대출 시스템에서는 헤더의 HTML이 고정

되어 페이지가 넘어가도 변경되지 않습니다.

헤더 코드를 반복적으로 작성하지 않기 위해 head.php 파일을 만들어야 합니다

각 파일에서 쉽게 호출할 수 있도록 헤더 HTML 코드를 작성합니다.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<table width="" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" >
  <tr>
    <td bgcolor="#FFFFFF"><img src="https://img.php.cn/upload/course/000/000/008/58215f071f35b180.jpg" width="440" height="200" /></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="440" height="50" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td align="center" background="https://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg">
          <a href="index.php" title="首页">首页</a></td>
          <td align="center" background="https://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg">
          <a href="index.php?proid=<?php echo urlencode('网页美工');?>" title="网页美工">网页美工</a></td>
          <td align="center" background="https://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg">
          <a href="index.php?proid=<?php echo urlencode('大数据');?>" title="大数据">大数据</a></td>
          <td align="center" background="https://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg">
          <a href="index.php?proid=<?php echo urlencode('asp编程');?>" title="asp编程">asp编程</a></td>
          <td align="center" background="https://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg">
          <a href="index.php?proid=<?php echo urlencode('php编程');?>" title="php编程">php编程</a></td>
          <td align="center" background="https://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg">
          <a href="index.php?proid=<?php echo urlencode('软件开发');?>" title="软件开发">软件开发</a></td>
          <td align="center" background="https://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg">
          <a href="landing.php"  title="用户登陆">用户登陆</a>&nbsp;&nbsp;
          </td>
        </tr>
      </table></td>
  </tr>
</table>

사용자의 로그아웃 기능도 여기에 추가됩니다:

<td align="center" background = "https://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg">
<a href="landing.php" title="用户登陆">用户登陆</a>&nbsp;&nbsp;
  <?php
  if ($_SESSION['id']){
    echo "<a href='landing.php?tj=out' title='退出'>退出</a>";
  }
  ?>
</td>

로그인 기능 페이지에서 판단하세요

<?php
//初始化session
if(isset($_GET['tj']) == 'out'){
  session_destroy();
  echo "<script language=javascript>alert('退出成功!');window.location='landing.php'</script>";
}
?>


다음 섹션
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <table width="" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" > <tr> <td bgcolor="#FFFFFF"><img src="http://img.php.cn/upload/course/000/000/008/58215f071f35b180.jpg" width="440" height="200" /></td> </tr> <tr> <td bgcolor="#FFFFFF"><table width="440" height="50" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" background="http://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg"> <a href="index.php" title="首页">首页</a></td> <td align="center" background="http://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg"> <a href="index.php?proid=<?php echo urlencode('网页美工');?>" title="网页美工">网页美工</a></td> <td align="center" background="http://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg"> <a href="index.php?proid=<?php echo urlencode('大数据');?>" title="大数据">大数据</a></td> <td align="center" background="http://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg"> <a href="index.php?proid=<?php echo urlencode('asp编程');?>" title="asp编程">asp编程</a></td> <td align="center" background="http://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg"> <a href="index.php?proid=<?php echo urlencode('php编程');?>" title="php编程">php编程</a></td> <td align="center" background="http://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg"> <a href="index.php?proid=<?php echo urlencode('软件开发');?>" title="软件开发">软件开发</a></td> <td align="center" background="http://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg"> <a href="landing.php" title="用户登陆">用户登陆</a>   </td> </tr> </table></td> </tr> </table>
코스웨어