PDA

View Full Version : Calendar does not display


seanlee
12-19-2007, 12:38 AM
When I navigate to the demo.php page, everything shows up. However, when I insert the code into my html page, nothing shows up. I even created a blank html page with the following 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=iso-8859-1" />
<title>Untitled Document</title>
<?php $CSS=1; require("calendar/calendar.php"); ?>
</head>
<body>
<?php $OL=1; require("calendar/calendar.php"); ?>
<?php require("calendar/calendar.php"); ?>
</body>
</html>
This outputs nothing. Am I doing something wrong? All my paths are correct!

-Sean

Brian
12-19-2007, 10:54 AM
Can you provide a link to this page where you've added your own code?

seanlee
12-19-2007, 01:52 PM
Can you provide a link to this page where you've added your own code?

http://www.pirateswag.com/store/asdf.html

Brian
12-19-2007, 01:56 PM
You need to name the file asdf.php in order for your server to execute PHP code.

seanlee
12-19-2007, 02:09 PM
You need to name the file asdf.php in order for your server to execute PHP code.

Wait... I thought you could include the calendar function in any website? What about websites that are not php? Can't you do a php include in an .html page in order to do this?

-Sean

Brian
12-19-2007, 02:54 PM
You can, as long as they parse php. Your server isn't set up to parse .html or .htm files as PHP.

You may can get your web host to change this for you, or simply rename the file to .php.

seanlee
12-19-2007, 03:31 PM
You need to name the file asdf.php in order for your server to execute PHP code.

That was the problem. I am on a cPanel server with php5 and the web server was not set to parse .html files for php code. I had to ask the admin to allow this option and now it works.

Thanks!

-Sean