Answers for "include php in html"

PHP
0

include external php file in html

<!DOCTYPE html>
 <html>
  <head>
  	<title>External PHP File</title>
  </head>
  <body>
  	<?php include 'example.php';?>
  <body>
</html>
Posted by: Guest on July-07-2021
1

load php in html

//Safe as:
index.html
number.php

//HTML:
<html>
   <head>
      <title>Home</title>
   </head>
   <body>
      <h1>Phone Number</h1>
      <?php include('number.php') ?>
   </body>
</html>

//PHP:
<?php
   echo 4895553268;
?>
Posted by: Guest on October-30-2020
9

php include html

<body>
<?php 
    define('ROOT_PATH', dirname(__DIR__).'/');
    include ROOT_PATH.'header.php';
    include ROOT_PATH.'main.php';
    include ROOT_PATH.'footer.php';
?>
</body>
Posted by: Guest on September-05-2021

Browse Popular Code Answers by Language