For a school project I need to put all returning code into an include. I want it all on one page, but I can't get it to work. Creating an include is no problem, but I want them all in one PHP page. I have the following code, but it is wrong:
//footer
<?php
class footer
{
echo '<a href="login.php">Account</a>';
echo '<a href="subscription.php">Subscription</a>';
echo '<a href="about.php">About us</a>';
echo '<a href="termsofuse.php">Terms of Use</a>';
echo '<small>© 2017, (myname) & (name partner)</small>';
}
?>
How do I have to modify the code, so that it is correct?
Assign the html code to variables.
<?php $footer = "<a href="login.php">Account</a>
<a href="subscription.php">Subscription</a>
<a href="about.php">About us</a>
<a href="termsofuse.php">Terms of Use</a>
<small>© 2017, (myname) & (name partner)</small>"
?>
After that you only need to include the one PHP file and <?php echo $footer ?>
for all parts of your page