Jump to content


Photo

Add a small php file into an html file


  • Please log in to reply
3 replies to this topic

#1 dan182skater

dan182skater
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 07 June 2006 - 06:12 AM

I have an html file I made with a blank area that I want to add a php file into. The php file is a small little file that is a billing system that I want to add to that blank area in my html file. How do I do this? I thought all I would need to do is use the php include function, but apparently I was wrong. Any help is appreciated. Thanks!

Daniel

#2 Ferenc

Ferenc
  • Members
  • PipPipPip
  • Advanced Member
  • 94 posts

Posted 07 June 2006 - 06:25 AM

the html file you want to have a php added to needs to be a php file...(your_file.php)

then, where ever in the html...
<?php include 'my_incuded_file.php'; ?>

Everything you want to know is here.

#3 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 07 June 2006 - 06:28 AM

You cant use php's include() function in a html file. If your using an apache server you might be able to use SSI's, but Im still not 100% sure they'll parse the php.
<!-- #include file="phpfile.php" -->
Otherwise... if you have control of the server you could also enable .html files to be parsed as php, then the php include() function would work.

#4 Moon-Man.net

Moon-Man.net
  • Members
  • PipPipPip
  • Advanced Member
  • 84 posts

Posted 07 June 2006 - 06:57 AM

The easiest way would be to rename the html document in question as <FILENAME.php> and then do what Ferenc said, just use php's Include function.
Cheers,
Nathan




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users