background image

初学 PHP 的 18 个基础例程

  如何创建我们的第一个 PHP 页面呢?非常简单的!选择我们使用的一个

 

最好的设计工具,当然你也可以 只使用记事本。创建之后记得要保存为扩展名
为 PHP 的文件,然后传到我们的服务器上。

  在编写 PHP 程序之前通常我们需要配置我们的环境,也就是说服务器要
支持 PHP 才能行啊

  一、PHP 的基本结构:

  使用 Include 函数

<Html> 
<Head> 
<title>Your page Subject and domain name</title>

  上面内容为我们使用的每个页面的标题,不要动。

  每个页的头部:

<Meta NAME="" CONTENT="">
"" your others meta tag
"" your others meta tag
"" your others meta tag
"" your others meta tag
"" your others meta tag
"" your others meta tag
"" your others meta tag
重要的 javascripts 代码放这
CSS 设置放这

  上述内容保 www.516fc.net 存为 header.php,使每个页面的头部都是
一样的。

<?PHP include("header.php")?> 

</head>
<body> 

  你的 www.hthrt.com 页的所有内容

</body>
</html>