Jump to content

Recommended Posts

Hi All,

 

I'm trying to call a .php page on another .php page and I can't remember the code for the life of me.

 

This is what I'm doing:

 

I have a menu in the header that will be on all the pages.  But I want to call the menu remotely as a seperate php page since I will undoubtedly be changing the menu in the future... and who wants to go back and change each page individually!

 

I appreciate the help.

 

 

Link to comment
https://forums.phpfreaks.com/topic/47906-i-need-to-call-a-php-page-help/
Share on other sites

Thanks all,

 

I'm not a wizard coder, so I need help with one more thing.  I put:

 

require('menu.php');

include('menu.php');

require_once('menu.php');

include_once('menu.php');

 

into my code and it didn't recognize it.  Do I have to put some kind of tag at the beginning and end of it?  I'm sticking it in a <td> tag.

 

Thanks again!

LOL! sorry... i meant those are your options... lol

 

require('menu.php'); --> requires menu.php to be included into the page, if its not there, ragnorak....

include('menu.php'); --> wants menu.php to be included into the page, if its not there, it shows a pretty error....

require_once('menu.php'); --> requires menu.php to be included into the page, if it hasnt been included/required before, if its not there, ragnorak....

include_once('menu.php'); --> wants menu.php to be included into the page, if it hasnt been included/required before, if its not there, it shows a pretty error....

OK, maybe I'm just stupid,  but it's still not working.  Here's the specific code I'm trying:

 

<td colspan="5">include('menu.php');</td>

 

It's read as text obviously, so what do I need to include so it's read as a code?  the menu I'm calling has to be placed in between the <td> tags.  As you can probably tell, I'm not used to coding PHP scripts. :)

 

Thanks for your help!

 

 

 

 

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.