Hi all,
Having recently bought 'Build Your Own Database Driven Web Site Using PHP & MySQL'. I went through the installation process and everything was absolutely fine. Unfortunately I had to do a restore and went through the installation again. I am having hair pulling out inducing problems now.
I have a simple count example that utilises an include, so there is a folder with index.php in it which has an include statement that displays the output in a count.html.php php file. This works fine.
I then have this example which is constantly producing the following:
Server error
The website encountered an error while retrieving http://localhost/output/. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
The codes is as follows and password is replaced with my root password:
index.php
output.html.phpPHP Code:<?php
$link = mysqli_connect('localhost', 'root', 'password');
if (!$link)
{
$output = 'Unable to connect to the database server.';
include 'output.html.php';
exit();
}
?>
Hopefully someone can help me out, it would be greatly appreciated.HTML Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <p> <?php echo $output; ?> </p> </body> </html>
Thanks


Reply With Quote


Bookmarks