PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I made a file (index.php) but when I open it with Google Chrome (or Mozilla doesn't matter) it doesn't display it! It just downloads it like it's a normal file. This is so crazy. It makes me so mad.
Does anyone have any idea what's wrong? I don't think it has anything to do with the code as it's just a tester but I will post it up here. This is the most ridiculous thing that's ever happened to me.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://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('l, F dS Y.');
?>
</p>
</body>
</html>
The answer is quite easy, you are attempting to open the file directly in Windows Explorer however Apache won't let that slide. Instead do it their way and type in the following:
I think that you are using PHP date function inside the Html. The Html file don't read php codes inside.. That way you are getting a blank page.. Tray to remove the php date. save it. And than open the html file in normal browser.