你正在使用什麼文本編輯器?因爲即時通訊使用記事本+ +和我基本上建立一個頭文件中的廣告只是調用,在例如HTML代碼的頂部:
header.php文件
<html>
<head>
</head>
<body>
<div class="login" style="width:101%;">
Username: <input type="text" name="uname"><br>
Password: <input class="align" style="margin-left:3px;" type="password" name="pword"><br>
<input class="button" type="button" onclick = "location.href = 'registration.php'" name="signin" value="Sign In">
<a href = "registration.php"><input class="button" type="button" name="register" value="Sign Up"></a>
<center>
<img src = "img/LOGO.jpg" style = "height: 80px; margin-top: -80px; width: 510px;">
</center>
</div>
<center>
<div class="nav">
<ul>
<li><button onclick = "location.href = 'welcome.php'"><a href="welcome.php">Welcome</a></button></li>
</ul>
<ul>
<li><button onclick = "location.href = 'hotel.php'"><a href="hotel.php">Hotel</a></button></li>
</ul>
<ul>
<li><button onclick = "location.href = 'room.php'"><a href="Room.php">Rooms</a></button></li>
</ul>
<ul>
<li><button onclick = "location.href = 'contactus.php'"><a href="contactUs.php">Contact Us</a></button></li>
</ul>
<ul>
<li><button onclick = "location.href = 'gallery.php'"><a href="gallery.php">Gallery</a></button></li>
</ul>
</div>
</center>
</body>
</html>
我用這個PHP代碼調用該文件對我的其他網頁:
<?php
include('templates/header.php');
?>
我的頭只是停留在頁面頂部的我不知道,如果我知道你想發生什麼,但是這是我的猜想希望它可以幫助FYI我只是個新手:)