- Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hello in PHP</title>
</head>
<body>
<h1>Hello in PHP</h1>
<?php
print "Hello, world!";
phpInfo();
?>
</body>
</html>
(only the HTML heading is shown, not "Hello, World!")
A webpage using PHP to show an external file does not work, either.
- Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Tip of the day</title>
</head>
<body>
<h1>Tip of the day</h1>
<?php
print "<h3>Here's your tip:</h3>";
?>
<div style = "border-color:green; border-style:groove; border-width:2px">
<?php
readfile("tips.txt");
?>
</div>
</body>
</html>
The book provides no assistance with this issue, and I can find no errors listed in XAMPP. I would appreciate any help. I am using XAMPP 1.8.1. with Control Panel 3.1.0 on Windows 7 Home Premium.