I have two files called index.php which is my main file and configFun.php file which includes all functions. I want to call a function function form configFun.php in a index.php but not anywhere it should be load in a specific div so how to implement that code.
I know how to call external function but i don't understood how to call that function in a specific div.
This is the index.php file
<?php require'config.php'; ?>
<html><body>
<p>Welcome to the homepage</p>
<br>
<hr>
<a href="?run=About">About</a><br>
<a href="?run=Contact">Contact</a> <br>
<a href="?run=0">Refresh No run</a>
<div class="dispArea">
</div>
</body></html>
This is configFun.php file
<?php
if (isset($_GET['run'])) $linkchoice=$_GET['run'];
else $linkchoice='';
switch($linkchoice)
{
case 'About' :
myAbout();
break;
case 'Contact' :
myContact();
break;
}
?>
<?php
function myAbout(){
echo 'we are just trying it for a demo.';
}
function myContact(){
echo 'Thanx for cantacting us';
}
?>
I want to call functions in the"dispArea" div how to implement the code.