First time user, error
Posted by: IanPSwift (---.hsd1.il.comcast.net)
Date: May 30, 2012 03:46AM

I'm trying to learn PHP and MySQL from a book, and it recommended I use this for an all-in-one system. When I load the localhost page everything is fine, I get a nice WampServer page listing the various versions of my software. However, when I load localhost/today.php I get a Server Error and the following message.

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

This was the first code from the book, and I placed the file in the C:/wamp/www subdirectory.

I've posted the code I wrote in case that helps. I need to learn this for a job, so any help would be greatly appreciated.

Code:
<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Strict//EN"
"[www.w3.org];
<html xmlns="htttp://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Today's Date</title>
<meta http=equiv="content-type"
content="text/html; charset=utf-8"/>
</head>
<body>
<p>Today's date (according to this web server is
<?php

echo date('1, F ds Y.)

?>
</p>
</body>
</html>

Options: ReplyQuote
Re: First time user, error
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: May 31, 2012 11:13PM

You are going to have to be a lot more careful when copying stuff from the book.

Copy and paste this ober your php section and try again



<?php

echo date('1, F d Y');

?>

Options: ReplyQuote
Re: First time user, error
Posted by: kevsy (---.66.8.109.rev.sfr.net)
Date: August 09, 2012 12:28PM

I'm rather new to all of this myself but here are two things that I will use a lot more in the future.

1. Insert. or die(mysql_error()); after the closing brace and before the semi-colon. Delete after use
2. Check your 'Apache error log' from the Wampserver open menu.

Another tip. I use 'phpacademy.org' and 'jream.com' I find them very useful for 'Monkey see what monkey do'.
A good healthy dose of that works wonders for me.

Options: ReplyQuote


Sorry, only registered users may post in this forum.