Hi, I am new to php, can anyone help. I am creating a website, I have a menu, I need it, so if I click the link1 link, page1.php will be loaded into the mainSection div, and if link2 is clicked, then page2.php will be loaded into mainSection, etc. etc., therefore, all pages: page1, page2, page3, etc. will load on this page depending on which link was clicked. Is this possible? I don’t know where to start. Thanks
<body>
<?php
<ul>
<li><a href="#" name="link1">link 1</a></li>
<li><a href="#" name="link2">link 2</a></li>
<li><a href="#" name="link3">link 3</a></li>
<li><a href="#" name="link4">link 4</a></li>
</ul>
?>
<div id="mainSection">
<?php
if (link1 == true){
include 'page1.php';
}
if (link2 == true){
include 'page2.php';
}
if (link3 == true){
include 'page3.php';
}
if (link4 == true){
include 'page4.php';
}
?>
</div>
</body>
source
share