Hello guys,
I was a beginner going thru some books I came across a part called the Command System (though they stated that there is no offical name for it) but this is what they mean by that "A central Processing PHP file that can be used to Reference other .php code funtion stored in different php script file for their functionalities to be executed when they are required".
here was an example. below is two differnt file
main.php
<?php
include ("welcome.php");
include ("page1.php");
switch($cmd)
{
case Page1:
showPage1();
break;
default:
showWelcome();
break;
}
?>
welcome.php
<?php
function showWelcome()
{
?>
<html>
<head><title>Welcome</title></head>
<body>
<center>This is Welcome page You are WELCOME</center>
<br><br>
You can also visit page 1.
<br>
<ul>
<li><a href="main.php?cmd=page1">Page 1</a></li>
</ul>
</body>
</html>
<?php
}
?>
page1.php
<?php
function showPage1()
{
?>
<center>
You are welcome to page 2 but You can also visit the main page
<br><br>
<ul>
<li><a href = "main.php?cmd=main">Main Page</a></li>
</ul
</center>
<?php
}
?>
so when I execute this code it only display the default switch statement and when ever i click on the page 1 link it only change the address in the address bar of the browser and nothing happens.
please help.
Am just a biginner if their is any probs in my code I will be gratefull to be corrected.
Thanks
Hakeem.