Jump to content

Archived

This topic is now archived and is closed to further replies.

dan182skater

Add a small php file into an html file

Recommended Posts

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

Share this post


Link to post
Share on other sites
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...[code]<?php include 'my_incuded_file.php'; ?>[/code]

Share this post


Link to post
Share on other sites
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.
[code]
<!-- #include file="phpfile.php" -->
[/code]
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.