On my site main.php
page's sidebar (shown on pic) have some feature for member only. Each feature is in different pages (form1.php, form2.php, etc...)
I want to know :
How can I call each form on main.php
. When I click on "inbox", it should call form1
, and when I click on "company profile" it should call form9
.
Is this possible to do without loading the whole main.php
file? If so, how?
If number 2 is too complicated, then please just help me with number 1, as that is my most important point.
do it this way
let us say you want to display the form on this div
<div id="display">
<!-- load it here-->
</div>
<!-- example this are your menus
when you click the inbox link it will call the inbox function
-->
<a href="javascript:inbox()">Inbox</a>
<a href="javascript:outbox()">Outbox</a>
<script>
function inbox() {
$("#display").load("form1.php");
}
function outbox() {
$("#display").load("form2.php");
}
</script>
you need to include jquery for this
It's possible to do this you can use two things for that
1- If the form have database things to show use ajax with jquery
2- If it's static content you can use bootstrap tab and showing what you want