Reputation: 7
I want to develop a site with Bootstrap css.
Because I will have some form that connect to the database, so I will make some of my file in HTML and the rest in PHP.
But the problem is that Bootstrap is only compatible in .HTML file.
So how I can do this? How to make it possible?
Upvotes: 0
Views: 42
Reputation: 794
just use save as in your text editor and save your html file as .php.
Upvotes: 0
Reputation: 2334
You can use HTML inside a PHP file just as if it was only a HTML file. You can place your
PHP is server side code meaning the server hosting the .php file interprets what code is within the tags and then displays the entire page to the browser just as any HTML page or similar depending on what your script does. The browser doesn't handle any PHP.
So to use bootstrap within a php page you could do something like this:
<?php
$example = 'example';
?>
<html>
<head>
<title>PHP in HTML Example</title>
<script src="js/bootstrap.min.js"></script>
<link rel='stylesheet' type='text/css' href='css/bootstrap.min.css'>
</head>
<body>
<h1>Short code <?=$example;?></h1>
</body>
</html>
Upvotes: 2