php and tempates for htm

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nomad
    Recognized Expert Contributor
    • Mar 2007
    • 664

    php and tempates for htm

    Hello everyone:
    I have a html template and I want to place a php file inside it.
    The html template has images and links.
    The php file is a simple one which opens a file listed below.

    [PHP]<?php
    $filename = "activite.t xt";
    $fp = fopen($filename , "r") or die("could not open $filename");
    while (!feof($fp)) {
    $line = fgets($fp, 1024);
    echo "$line<br>" ;
    }
    ?>[/PHP]

    I have tried place the php inside the php file and open it on a browser but the images do not show up. Any ideals on how to solve this.
    Does php except anything else other than a .txt file. Can i use .doc or any other extension?

    Thanks
    nomad

    PS I think I figure it out. I need to send all the temp files to the test server. I hope this is right, if so or if not please still respond.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    Originally posted by nomad
    Does php except anything else other than a .txt file. Can i use .doc or any other extension?
    As far as I know there's no restriction what the extension can be, the question is, whether php (resp. your script) can handle the content (which is surely true for unformatted text (like txt, php, xml)). But I doubt that php can parse/understand (maybe there's a better word for that?) a doc file (except someone wrote an import function).

    Comment

    Working...