animefanum Posted June 19, 2007 Share Posted June 19, 2007 I havent been working with php for very long and now I am stuck, I want 2 include on the page, one is for my visual menu and the other is for the news and content. What I want is for the the visual menu just to change when the tabs are clicked but not the news page, unless it was clicked via the main navigation. I am stuck as to how to do this, can some one help me? www.animefanum.co.nr Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/ Share on other sites More sharing options...
cooldude832 Posted June 19, 2007 Share Posted June 19, 2007 show your code, but for an include its include($file) make $file by dynamic off what view you want either from a GET var or a SESSION Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277319 Share on other sites More sharing options...
animefanum Posted June 19, 2007 Author Share Posted June 19, 2007 I have no idea what you just said but here is the codes i used. This is the visual php include. <? $ext = ".php"; $id = "".$visual."".$ext.""; $static = TRUE; if (file_exists($visual)) { include($visual); } else { include("front.php"); } ?> News and content <? $ext = ".php"; $id = "".$id."".$ext.""; $static = TRUE; if (file_exists($id)) { include($id); } else { include("news/show_new.php"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277323 Share on other sites More sharing options...
cooldude832 Posted June 19, 2007 Share Posted June 19, 2007 don't see where your issue is? are your triyng to make $id variable? Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277327 Share on other sites More sharing options...
animefanum Posted June 19, 2007 Author Share Posted June 19, 2007 you mean that it should work? but when i click the graphics link it does not work it stays on the front page. Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277329 Share on other sites More sharing options...
cooldude832 Posted June 19, 2007 Share Posted June 19, 2007 can you show me a link to the page please? I don't see how the graphic ties in. Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277332 Share on other sites More sharing options...
animefanum Posted June 19, 2007 Author Share Posted June 19, 2007 http://animefanum.co.nr/index.php there is my page, i havent opened yet. You can see the tabs, if you click on the graphics tab you can see nothing comes up, i have made sure all the files are in the right folder and they have the right extension and that i have link them properly. Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277337 Share on other sites More sharing options...
cooldude832 Posted June 19, 2007 Share Posted June 19, 2007 something else strange is happening because the url isn't changing on click your issue is that $visual is not equal to that value you have set the variable you are placing in the url ?visual=front/graphics is accessible by saying $_GET['visual'] try that, but first you need to see why your links aren't working right. Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277343 Share on other sites More sharing options...
animefanum Posted June 19, 2007 Author Share Posted June 19, 2007 thank you i will see what is happening with my links and then report back. Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277344 Share on other sites More sharing options...
cooldude832 Posted June 19, 2007 Share Posted June 19, 2007 your free hosting might not let you process variables Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277369 Share on other sites More sharing options...
animefanum Posted June 19, 2007 Author Share Posted June 19, 2007 it should do, because it allows for cute news... do that not contain variables? Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277373 Share on other sites More sharing options...
cooldude832 Posted June 19, 2007 Share Posted June 19, 2007 okay i got http://animefanum.freeweb7.com/index.php?v=graphics to load and the box is empty. can i see your code now? Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277374 Share on other sites More sharing options...
cooldude832 Posted June 19, 2007 Share Posted June 19, 2007 try this for your menu area <?php if(ISSET($_GET['v'])) { switch ($_GET['v']) { case graphics: $visual = "graphics.html"; break; case video: $visual = "video.html"; break; case music: $visual = "music.html"; break; case art: $visual = "art.html"; break; default: $visual = "default.html"; } } else { $visual = "default.html"; } include($visual); ?> Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-277377 Share on other sites More sharing options...
animefanum Posted June 21, 2007 Author Share Posted June 21, 2007 sorry man the code doesnt work T_T... tried it. What i think is happening, the 2 code are interferring with each other and i need some way of stopping that $static= TRUE; doesnt work. Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-278964 Share on other sites More sharing options...
animefanum Posted June 21, 2007 Author Share Posted June 21, 2007 i fixed the problem... thank you for the help ... i am very happy .... Quote Link to comment https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/#findComment-278976 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.