how to include php function in html page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jigaruu
Forum Newbie
Posts: 21
Joined: Wed Feb 18, 2004 11:46 pm
Contact:

how to include php function in html page

Post by jigaruu »

i have got a function ready in my php page and the same is need to be called in the html page,

the function does the work of displaying the image and counts and do many other work,

so i need to run that particular function in particular <TD> tag. so can any one help me to include the same and also how to include the files supporting that php page in the html page.

thanks in advance.
doeboy
Forum Newbie
Posts: 10
Joined: Sun Mar 21, 2004 10:18 am

Post by doeboy »

If you are wanting to call/use php functions, the file must be a .php file. Just rename your.html file to .php and you will be fine.
User avatar
werlop
Forum Commoner
Posts: 68
Joined: Sat Mar 22, 2003 2:50 am
Location: /dev/null

Post by werlop »

Remember you can jump in and out of php simply by using the <?php ?> tags.

eg

<html>
<?php
// Whatever
?>

<head>

etc......


</html>



This will work fine as long as you save as .php

or you could modify the Apache config to allow php to parse .html files instead of or as well as .php files
Post Reply