orfeus123 Posted April 20, 2007 Share Posted April 20, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/47906-i-need-to-call-a-php-page-help/ Share on other sites More sharing options...
taith Posted April 20, 2007 Share Posted April 20, 2007 require('filepath'); include('filepath'); require_once('filepath'); include_once('filepath'); Quote Link to comment https://forums.phpfreaks.com/topic/47906-i-need-to-call-a-php-page-help/#findComment-234113 Share on other sites More sharing options...
Gruzin Posted April 20, 2007 Share Posted April 20, 2007 require('filepath'); include('filepath'); require_once('filepath'); include_once('filepath'); Note: allow_url_fopen should be on Edit: sorry I thought he wanted to include a file form another server.... Regards, George Quote Link to comment https://forums.phpfreaks.com/topic/47906-i-need-to-call-a-php-page-help/#findComment-234132 Share on other sites More sharing options...
orfeus123 Posted April 20, 2007 Author Share Posted April 20, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/47906-i-need-to-call-a-php-page-help/#findComment-234149 Share on other sites More sharing options...
taith Posted April 20, 2007 Share Posted April 20, 2007 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.... Quote Link to comment https://forums.phpfreaks.com/topic/47906-i-need-to-call-a-php-page-help/#findComment-234156 Share on other sites More sharing options...
orfeus123 Posted April 20, 2007 Author Share Posted April 20, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/47906-i-need-to-call-a-php-page-help/#findComment-234222 Share on other sites More sharing options...
per1os Posted April 20, 2007 Share Posted April 20, 2007 <td colspan="5"><?php include('menu.php');?></td> Maybe actually using php syntax might help? Quote Link to comment https://forums.phpfreaks.com/topic/47906-i-need-to-call-a-php-page-help/#findComment-234223 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.