Change to PHP include?

Change to PHP include?

Posted by: Hope
Posted on: 2009-08-30 18:15:00

When I tried to access my site earlier, my browser asked if I wanted to download the page (tried it in both IE and FF). In the .htaccess file I disabled this line:
AddType application/x-httpd-php .php .html
Once I did that, it allowed me to view the page but the php include file is not showing.
This is the line I've been using for the includes:
<?php include("/home/user/mydomain.com/inc/header.htm");
It has worked up until now and is still working on several other sites I have on the same DH server. I don't understand why it would work on one site and not on another.

Can anyone tell me either what I've done wrong or what has changed recently?

Thanks,

Hope

Re: Change to PHP include?

Posted by: sdayman
Posted on: 2009-08-30 18:30:00

You need the following at the end of that php line:
?>
so you can close the PHP statement.

-Scott

Re: Change to PHP include?

Posted by: Hope
Posted on: 2009-08-30 18:40:00

Thanks. That was a typo on my part when posting the message. The ?> is at the end of the line in the actual file.

Since posting, I've resolved the issue. What I needed to do was change the line in .htaccess to reflect PHP 5. I just don't understand why it is working on other sites.

Does anyone know when the servers were upgraded to PHP5?

Re: Change to PHP include?

Posted by: sdayman
Posted on: 2009-08-30 18:53:00

Servers have been PHP5 for quite a long time. However, old PHP4 sites were left intact but any domains that get moved or otherwise reconfigured get bumped to PHP5.

-Scott

Re: Change to PHP include?

Posted by: Hope
Posted on: 2009-08-30 21:23:00

How can I find out if my site has been moved? It still shows iceman as the server...

In reply to:

Servers have been PHP5 for quite a long time. However, old PHP4 sites were left intact but any domains that get moved or otherwise reconfigured get bumped to PHP5.


Re: Change to PHP include?

Posted by: Atropos7
Posted on: 2009-08-31 00:56:00

To find out the PHP version a script needs to call phpversion() or you can make a script like so:

<?php phpinfo() ?>

Which makes a web page that shows just about everything a developer might want to know.



Customer since 2000 cool openvein.org

Re: Change to PHP include?

Posted by: Hope
Posted on: 2009-08-31 06:10:00

Thanks. I did that and that's how I discovered it was PHP5. My question is, why would it stop working if it had been working all along? I have submitted a ticket to support. Hopefully, they will clear up the mystery.

In reply to:

To find out the PHP version a script needs to call phpversion() or you can make a script like so:
<?php phpinfo() ?>


Tags: php htmlhtaccessff