+ 3
Can i use PHP with HTML? and Where can use PHP in <body> and <head>?
6 Réponses
+ 5
yes
+ 5
You can use it anywhere you want
<head>
<base href=<?php echo "http://" . $_SERVER["HTTP_HOST"] ?>>
</head>
+ 5
No because the output would be
<head>
hello
</head>
And that's not what head tag is used for
+ 4
<body>
<?php if(isset($_SESSION["login"])) {
<p>
Logged in as <?php echo $_SESSION["login"]["name"]; ?>
</p>
<?php } ?>
</body>
+ 2
But can use?
<head>
<?php echo "hello" ;
?>
</head>
+ 2
Thanks for answers