我有下面的HTML模板,我想把它放到一個PHP文件中,我的問題是我只是用<?php ?>
包裝模板,還是我需要更改JavaScript包含和CSS樣式標記?如何將這個基本的html(CSS,JavaScript)模板包含到php文件中?
這裏是模板
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="keywords" content=" some keywords for the bots">
<meta name="author" content="my name here">
<meta name="description" content="all about stuff here">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>site name</title>
<link rel="shortcut icon" href="favicon.ico">
<link href="style.css" rel="stylesheet" type="text/css" media="screen">
</head>
<body onload="javascript_function()">
<script language="JavaScript" src="js_include.js"></script>
</body>
</html>
只是把它的PHP文件,擴展名.php只是告訴瀏覽器,有PHP需要被看着。普通的html仍然適用。將您的''放入''標籤中凡有必要 –
由於您的模板中沒有PHP代碼,只需在php文件中將此代碼寫入而不使用php標籤 – Zeeshan