Jump to content

[SOLVED] Link to a PHP require/include.


AshleyByrom

Recommended Posts

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.