Switch Command
Posted: Wed Nov 12, 2008 10:46 am
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
I am a dbase programmer - at least I was 15 years ago when I got burned out. This is my first serious look at reestablishing my programming skills, although I have done some HTML progrmming over the years, it left quite a bit to be desired. I am a firm believer in subroutines, something HTML couldn't fully accomplish. I have about 30 pages on the website I am developing and don't want to have to maintain 30 fully coded pages.
Are there any major problems with the concept of the following code? (I substituted [] for <>)
Thanks in advance,
Steve
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
I am a dbase programmer - at least I was 15 years ago when I got burned out. This is my first serious look at reestablishing my programming skills, although I have done some HTML progrmming over the years, it left quite a bit to be desired. I am a firm believer in subroutines, something HTML couldn't fully accomplish. I have about 30 pages on the website I am developing and don't want to have to maintain 30 fully coded pages.
Are there any major problems with the concept of the following code? (I substituted [] for <>)
Code: Select all
<? php
include(header.php)
$bodytext = 0; //This actually gets its value from the header in the mapped areas so I will delete this from the real code
switch ($bodytext) {
case "1" :
include(aboutus.php);
break;
case "2" :
include(contactus.php);
break;
default :
include(index.php);
break;
}
include(footer.php)
?>Steve
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: