我正在从一本书中学习PHP,我从书籍网站复制了以下代码。当我在Zend Studio中运行并选择任何超链接时,例如 Home ,所有显示的都是php文件的名称。例如 index.php 。它不链接并执行php文件。那是为什么?
非常感谢任何帮助,谢谢。
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Class Registration Template</title>
<link rel= "stylesheet" type= "text/css" href= "C:\Users\trevor.reeves\Documents\PHP&mySQLBook\php-mysql-abg-listings-1\ClassRegistration_Public/registration.css"/>
<script type= "text/javascript"></script>
</head>
<body>
<div id="wrapper">
<div id="header">
<img src="C:\Users\trevor.reeves\Documents\PHP&mySQLBook\php-mysql-abg-listings-1\ClassRegistration_Public/MatTechLogo.gif" alt="Matthews Technology" />
<h1 id="title">Class Selection and Registration</h1>
</div> <!-- id="header" -->
<div id="hnav">
<table width="400" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><a class="hmenu" href="index.php">Home</a> </td>
<td><a href="index.php">About</a> </td>
<td><a href="index.php">Support</a> </td>
<td><a href="/AdministratorAuthentication/adminAuthen.php">Maintain</a> </td>
</tr>
</table>
</div> <!-- id="hnav" -->
<div id="vnav">
<table width="120" border="0" cellspacing="2" cellpadding="2">
<tr>
<td id="vhead">Go To: </td>
</tr>
<tr>
<td><a href="classlist.php">Class List</a> </td>
</tr>
<tr>
<td><a href="nameentry.php">Student Entry</a>
</td>
</tr>
</table>
</div> <!-- id="vnav" -->
<div id="main">
<h1 id="maintitle">Spring Class Schedule</h1>
<p id="mainpara">Click Register to do so for a class.</p>
<p class="red">*A footnote.</p>
</div> <!-- id="main" -->
<div id="footer">
<p id="copyright">
Copyright ©:2008 -
<?php
date_default_timezone_set('America/Vancouver');
echo date('Y');
?>
Matthews Technology
</p>
<p id="contact">
<a href="mailto:info@matthewstechnology.com">Contact us by clicking here.</a>
</p>
</div> <!-- id="footer" -->
</div> <!-- id="wrapper" -->
<?php
;
?>
</body>
</html>
答案 0 :(得分:0)
您正在使用磁盘操作系统使用的文件引用来访问文件。您需要使用服务器正在使用的引用。通常它是localhost / directory / filename.php localhost将指向服务器指示它指向的位置,该位置位于php.ini文件中。