0
you can call a php function from html have include?
3 Antworten
+ 1
No this is not possible, since you must be in an .PHP file to use PHP
0
A little late, but try this. This defintely works for me:
<?php
yourFunction() {
$var = "whatever you want to do in this funct";
}
?>
<!DOCTYPE html>
<html>
<body>
<h1>Welcome to my home page!</h1>
<p>Some text.</p>
<p>Some more text.<?php yourFunction(); ?></p>
</body>
</html>
BTW....you have to save your file as .php. You can't run it as a .html file and expect the php engine to parse it. It's a PHP server.
- 1
<html>
<body>
<h1>Welcome to my home page!</h1>
<p>Some text.</p>
<p>Some more text.</p>
<?php include 'footer.php';?>
</body>
</html>