PHP développe un système simple de prêt de livres pour créer une page Web publique
Dans notre système de prêt, le HTML dans l'en-tête est fixe
et ne change pas au fur et à mesure que la page saute.
Afin de ne pas écrire le code d'en-tête à plusieurs reprises, nous devons créer un fichier head.php
Écrivez le code HTML d'en-tête pour faciliter l'appel dans chaque fichier.
<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>
</td>
</tr>
</table></td>
</tr>
</table>La fonction de déconnexion de l'utilisateur est également ajoutée ici :
<td align="center" background = "https://img.php.cn/upload/course/000/000/008/58215f29827c0755.jpg">
<a href="landing.php" title="用户登陆">用户登陆</a>
<?php
if ($_SESSION['id']){
echo "<a href='landing.php?tj=out' title='退出'>退出</a>";
}
?>
</td>Faites un jugement sur la page de la fonction de connexion
<?php
//初始化session
if(isset($_GET['tj']) == 'out'){
session_destroy();
echo "<script language=javascript>alert('退出成功!');window.location='landing.php'</script>";
}
?>
nouveau fichier
<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>
Aperçu
Clear
- Recommandations de cours
- Téléchargement du didacticiel
Le didacticiel n'est pas disponible au téléchargement pour le moment. Le staff est actuellement en train de l'organiser. Veuillez prêter plus d'attention à ce cours à l'avenir ~
Les étudiants qui ont regardé ce cours apprennent également
Parlons brièvement de la création d'une entreprise en PHP
Introduction rapide au développement web front-end
Développement pratique à grande échelle par Tianlongbabu du cadre MVC version Mini imitant le site Web de l'encyclopédie des choses embarrassantes
Premiers pas avec le développement pratique PHP : création rapide de PHP [Small Business Forum]
Vérification de connexion et forum de discussion classique
Collecte de connaissances sur les réseaux informatiques
Démarrage rapide de la version complète de Node.JS
Le cours front-end qui vous comprend le mieux : HTML5/CSS3/ES6/NPM/Vue/...[Original]
Écrivez votre propre framework PHP MVC (40 chapitres en profondeur/gros détails/à lire absolument pour que les débutants progressent)
















