PDA

View Full Version : This is sort of a weird problem..



ShreddersDojo
08-01-2006, 09:55 PM
The script works fine in PHP on my server..

http://www.shreddersdojo.com/index2.php

However,

My new site was encoded as xml, but saved as an htm file. I tried it there, and this is the result.. http://www.shreddersdojo.com/testpage.htm


Any ideas?

Patrick
08-01-2006, 10:54 PM
I don't understand how it is strange.

On your index2.php page the script works properly as the page is being parsed for PHP (since it has name .php).

On your testpage.htm the script does NOT work properly as the page is NOT being parsed for PHP (it has extension .htm).

On your testpage.htm You have the code:

?php
include_once("/home/krang1/domains/shreddersdojo.com/public_html/Forum/news.php");
$forum_obj = new EP_Dev_Forum_News();
AddHandler application/x-httpd-php .php .html .htm
$forum_obj->display_Headlines("5", "26", "0", "0"); ?>

I can see where you are trying to tell your webserver to parse htm, html for PHP... but you need to place that line in a ".htaccess" file and place it in your site's public_html folder. A .htaccess file is simply an ordinary text file named .htaccess

In your .htaccess file, you should have:


AddHandler application/x-httpd-php .php .html .htm


Alternatively, I would suggest that you simply rename your pages to .php

ShreddersDojo
08-01-2006, 11:12 PM
I saw that on the site, but for some reason it didn't work..

So I should create a .htaccess file with JUST this
AddHandler application/x-httpd-php .php .html .htm


in it, and put it in my public_html directory, and it should work?

I tried renaming it .php, but all the images dissapeared, as well as the div 'tables'..

Patrick
08-02-2006, 12:12 AM
Regardless of what you do, make sure that you print your top line with PHP:

<?php echo '<?xml version="1.0"?>'; ?>
Rest of your <html>, etc ...