I have a signin.php file that can be used in multiple web pages where users can sign in via the pop up window. This file includes
<?php
//some code to process submitted sign up form
?>
<div>
// some html code for the sign in pop up window
</div>
I want to include signin.php in other html page files. Do I need to wrap the html code above with !DOCTYPE html, html, head, or body tag? I tested it seems it works without these tags. Thanks.
CodePudding user response:
No, if your going to just include the tags from another file then you don't need to put the <html>
tag because if your code is
<!DOCTYPE html>
<html>
<head></head>
<body>
<div>
<?php include("hello.php")?>
</div>
</body>
</html>
and in hello.php you just have an h1 tag with hello it will get rendered as
<div>
<h1>Hello</h1>
</div>