Jump to content

Issue with Include function in PHP5


jdbarry

Recommended Posts

Hi All,

 

My service provide just switched to PHP5.  I use the include function alot on my site to load various content but mainly CGI/Perl.

 

Previously, it would execute and then output the content to the site but since upgrading, it seems to be outputting all the CGI code and prints out the HTML as HTML, not executing any of the code.  Non-cgi pages (html, php) print out normally.

 

I've looked every where and tried doing things differently to no avail.  Tried the exec function but it is disabled.

 

Does anybody of a work around?

 

Note:  I used the include statement as include($_GET['page']).  So sometime I'm loading cgi, php or html.  I would need a solution that can load all 3 the way it worked before.

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/97217-issue-with-include-function-in-php5/
Share on other sites

If you want to include only the output of the cgi script then I'd include it using the http:// wrapper, eg:

include 'http://www.mysite.com/' . $_GET['page'];

For html/php files don't include the http:// wrapper.

 

However it would be better to convert your cgi script to PHP.

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.