jeff5656 Posted December 8, 2008 Share Posted December 8, 2008 I want to include a file (lets say test.php) that resides on a server on the intranet. The main file can be accessed from anywhere since it resides on the internet. If someone is on the intranet they will see both files, but if they're at home they will see an error in the <td> that has the include file. How do I suppress errors in the main page for this so that the person will see all of the main file but the include file will give ablank? Something like this? <table> <td> content of main page </td> <td><?php include "http://intranetserver/directory/test.php" or die (???);?></td> <td> rest of content from main page BTW, does anyone notice that if you goto phpfreaks.com and sign in, then you click forums it says "welcome guest" and you have to sign in again?? Weird (and ironic for a site specializing in web-design/programming/code) Quote Link to comment https://forums.phpfreaks.com/topic/136126-question-on-include/ Share on other sites More sharing options...
Prismatic Posted December 8, 2008 Share Posted December 8, 2008 <?php error_reporting(0); ?> <td> content of main page </td> <td><?php include "http://intranetserver/directory/test.php" or die (???);?></td> <td> rest of content from main page Quote Link to comment https://forums.phpfreaks.com/topic/136126-question-on-include/#findComment-709886 Share on other sites More sharing options...
premiso Posted December 8, 2008 Share Posted December 8, 2008 BTW, does anyone notice that if you goto phpfreaks.com and sign in, then you click forums it says "welcome guest" and you have to sign in again?? Weird (and ironic for a site specializing in web-design/programming/code) Just thought I would let you know, they are 2 different backends, one is a forum the other is probably a CMS. It is hard to integrate two systems not related to each other for a dual login purpose. Quote Link to comment https://forums.phpfreaks.com/topic/136126-question-on-include/#findComment-709888 Share on other sites More sharing options...
jeff5656 Posted December 8, 2008 Author Share Posted December 8, 2008 Thanks. How do I turn error reporting back on and where does this go? Because I only want to suppress errors for that one include statement. Quote Link to comment https://forums.phpfreaks.com/topic/136126-question-on-include/#findComment-709894 Share on other sites More sharing options...
PFMaBiSmAd Posted December 8, 2008 Share Posted December 8, 2008 Since php on the server where the main file is at is what executes the include statement, it does not matter where you are at when you request the main file. If the include works, it will work for all requests for the main file. Quote Link to comment https://forums.phpfreaks.com/topic/136126-question-on-include/#findComment-709895 Share on other sites More sharing options...
jeff5656 Posted December 8, 2008 Author Share Posted December 8, 2008 So could I do something like this? <?php error_reporting(0); ?> <td> content of main page </td> <td><?php include "http://intranetserver/directory/test.php"; error_reporting(1);?></td> <td> rest of content from main page to turn it back on? Quote Link to comment https://forums.phpfreaks.com/topic/136126-question-on-include/#findComment-709913 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.