0

I basically have a php header like this

<body>
<h1>Title</h1>
</body>

That is contained in a header.php file, but when I'm on another page for example

<?php include(header.php) ?>

How would I make it so that you could change the h1 Title in the header.php on the destination webpage. I have tried putting in the h1 in the header, and then putting on the destination page, but this hasn't worked for me. Is there any way to simplify do this.

1 Answer 1

2

I think this is what you are asking:

header.php:

<body>
<h1><?php echo $title;?></h1>
</body>

other page

<?php 
$title ='fish';
include('header.php');
?>
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for answering my question, It is kind of silly that it was something as simple as statement order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.