Jump to content


Photo

PHP in HTML


  • Please log in to reply
3 replies to this topic

#1 zrohrer

zrohrer
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 October 2006 - 07:31 PM

ok, i had a website that used all PHP with some html and all i had to do to change the text on the front page was change a text file. Now im using HTML and want to do the same thing but the php code isnt working and ive checked many tutorials and they all say the same thing that ive done the code is..

                            <?php
                            
                             echo htmlentities(file_get_contents("home.txt"));
                             
                            ?>

Thanks

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 21 October 2006 - 07:35 PM

What is the name of the file that contains the PHP? if it end in ".html" it won't work. It needs to end in ".php" so the PHP processor is invoked.

Ken

#3 zrohrer

zrohrer
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 October 2006 - 07:38 PM

ill try that the file name is index.html

#4 zrohrer

zrohrer
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 October 2006 - 07:39 PM

ok thanks dude, it works now.

seriously thanks a ton




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users