+ Reply to Thread
Results 1 to 4 of 4

Thread: This is sort of a weird problem..

  1. This is sort of a weird problem..

    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?

  2. Join Date
    Aug 2004
    Posts
    781

    Re: This is sort of a weird problem..

    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 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:
    Code:
    AddHandler application/x-httpd-php .php .html .htm
    Alternatively, I would suggest that you simply rename your pages to .php

  3. Re: This is sort of a weird problem..

    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'..


  4. Join Date
    Aug 2004
    Posts
    781

    Re: This is sort of a weird problem..

    Regardless of what you do, make sure that you print your top line with PHP:
    PHP Code:
    <?php echo '<?xml version="1.0"?>'?>
    Rest of your <html>, etc ...

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts