我有下面的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