AshleyByrom Posted July 21, 2009 Share Posted July 21, 2009 Okay, well here is my problem. I have one page.. inside that is a few PHP require()'s that load seperate pages into that page. Simple.. But, i want to be able to add a link to my page that will CHANGE that PHP include/require. For example. Say I have three pages... index.php, home.php, about.php On index.php there will be a <a href="home.php" blah blah that links to home.php. there will also be a PHP require that adds home.php to the page. When i click the link to ABOUT.PHP i want the php require to change from home.php to about.php. Is this possible? Anything similar I could try? I would use an iFrame but, i think i would probably get shot... Quote Link to comment https://forums.phpfreaks.com/topic/166763-solved-link-to-a-php-requireinclude/ Share on other sites More sharing options...
jayjay960 Posted July 21, 2009 Share Posted July 21, 2009 This isn't possible with php, php is a server-side language which means everything is processed and parsed on the server and the client just gets the page that comes out the other end. if you wanted to just use php you would have to reload the page. Also, yes you would probably get shot and die a most painful death if you used an iframe, but you could also try ajax. That uses javascript to load a page and then you could put the results in a div or something. Quote Link to comment https://forums.phpfreaks.com/topic/166763-solved-link-to-a-php-requireinclude/#findComment-879351 Share on other sites More sharing options...
AshleyByrom Posted July 21, 2009 Author Share Posted July 21, 2009 I decided to do what I couldnt be botherd doing. Basically i had a page with a PHP require. I switched that round so I had pages that had require('header.php'); etc. Same principles apply, I guess this is better. Thanks for clearing it up! Quote Link to comment https://forums.phpfreaks.com/topic/166763-solved-link-to-a-php-requireinclude/#findComment-879386 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.