Jump to content

I need to call a php page. Help!


orfeus123

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!

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

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