insert php in html code example
Example 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;
?>
Example 2: insert an html page into php
<?php
include('fileOne.html');
include('fileTwo.html');
?>
Example 3: inline php in html
<body>
Hello, today is <?php echo date('l, F jS, Y'); ?>.
</body>
Example 4: insert php code
<?php
$host = "localhost";
$username = "username";
$pass = "";
$db="furniture";
$conn=mysqli_connect($host,$username,$pass,$db);
if(!$conn){
die("Data connection error");
}
?>