Forum Moderators: coopster

Message Too Old, No Replies

Basic PHP Problem? Help greatly appreciated.

Index.php isn't loading on its own, code not working!

         

Zhariken

9:29 pm on Feb 25, 2008 (gmt 0)

10+ Year Member



Hi,

I've run into a problem a .php page I built, I was hoping someone here could give me a bit of an explanation.

I built a page in .php and was constantly testing it on my Dreamhost account, no problems.

I finally complete the page and move it to our in-house server for public hosting, and it's not quite working right anymore.

e.x.: If I type www.dreamhosttestsite.com/test/ . . . the server will automatically load www.dreamhosttestsite.com/test/index.php

However, if I type www.inhouselivesite.com/test/ . . . the server returns this...:

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403
(domain name)
Monday, February 25, 2008 16:12:03
Apache/2.0.59 (NETWARE) mod_jk/1.2.21

Also, in IE, the following code doesn't work when the page is on our server:

<td><INPUT TYPE="text" SIZE="40" name="date" value="<? print(Date("l F d, Y")); ?>"></td>

Instead of printing the date out, all you see is the code in the box.

When trying to view the page in Firefox on our server, you just see all the code, no page is displayed at all.

Is this something incredibly basic I'm missing?

Here is the top of my index.php:

<HTML>
<HEAD>
<TITLE>(title here)</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">

Could the content-type be the problem?

In-House Server:
Shows the page, but at least one of the components of the page doesn't work in IE
Shows the actual code of the .php document...doesn't display page in Firefox.
PHP 5.0.x?

Dreamhost:
Looks fine in IE
Looks fine in Firefox
PHP 5.2.2

Thank you.

-Justin

[edited by: Zhariken at 9:33 pm (utc) on Feb. 25, 2008]

RonPK

10:17 pm on Feb 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The first problem is perhaps caused by Apache not knowing that index.php should be treated as a directory index file. In httpd.conf, find the line that looks like this:

DirectoryIndex index.html

Add index.php:

DirectoryIndex index.html index.php

Save and restart Apache.

The second problem may be caused by the use of the

<?
shorthand tag. Try using
<?php
instead.

[edited by: RonPK at 10:17 pm (utc) on Feb. 25, 2008]