johnwhello Posted October 13, 2006 Share Posted October 13, 2006 At http://www.michaellobry.com/ are buttons: contact, about us, etc.Once clicked on one, say: 'contact', i want the current include:var includingMain = include "HTMLversion_index.php";change into an 'aboutUs' include as follows:include "aboutUs.php";Furthermore i have:<area onclick="URLforwardProcessingAfterClick();" name="hireMe" shape="rect" coords="400,0,550,100" href="hireMe.php" alt="Hire me" />And here the PHP function:function URLforwardProcessingAfterClick() {if (contact) { includingMain = include "mailFormInput.php"; else if(aboutUs) { includingMain = include "aboutUs.php"; else if(sitemap) { includingMain = include "sitemap.php"; else if(hireMe) { includingMain = include "hireMe.php"; else if(searching) { includingMain = include "searching.php";}}}}}}Above script doesn't work. Help! Quote Link to comment Share on other sites More sharing options...
zq29 Posted October 13, 2006 Share Posted October 13, 2006 Are you sure that this is PHP related? Looks more like JavaScript syntax to me... Quote Link to comment Share on other sites More sharing options...
kanikilu Posted October 13, 2006 Share Posted October 13, 2006 [code]function URLforwardProcessingAfterClick() {if (contact) { includingMain = include "mailFormInput.php"; else if(aboutUs) { includingMain = include "aboutUs.php"; else if(sitemap) { includingMain = include "sitemap.php"; else if(hireMe) { includingMain = include "hireMe.php"; else if(searching) { includingMain = include "searching.php";}}}}}}[/code]If that's supposed to be PHP, you've got some problems. First, it looks like you are trying to use variables (contact, includingMain, aboutUs, etc.) however you didn't preceed them with "$". Next, each of those else if's need to be closed of individually instead of all at the same time like you have it.For example (I'm assuming that those are variables here):[code]if ($contact) { $includingMain = include "mailFormInput.php"; else if($aboutUs) { $includingMain = include "aboutUs.php"; } else if($sitemap) { $includingMain = include "sitemap.php"; } else if($hireMe) { $includingMain = include "hireMe.php"; } else if($searching) { $includingMain = include "searching.php"; }}[/code]...and if that's not supposed to be PHP, I think you have wrong forum ;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.