Jump to content

require question


lamonkey

Recommended Posts

When you ask the mydomain.com server for the page http://mydomain.com/header.php, you'll receive the processed version of header.php, not the source page.

 

Example: if header.php is:

<?php
    echo 'Test';
?>

,

you'll receive Test instead of the code above.

 

Had what you ask be possible, all our PHP sites would have been down by now :) It would have been one of the major security risk, to be able to require/include remote files.

Link to comment
https://forums.phpfreaks.com/topic/122049-require-question/#findComment-630048
Share on other sites

Thanks. Let me ask another way.  On my webpage, I want to call both the header and footer PHP scripts from another URL. Currently it uses the require () command, but since it's not a relative address... it doesn't work. Can any of you PHP gurus give me some advice on how to accomplish this???

 

Again, any help greatly appreciated...

Link to comment
https://forums.phpfreaks.com/topic/122049-require-question/#findComment-630055
Share on other sites

you can also try file_get_contents, but again, all you're going to get is the parsed output, not any actual serverside code.  There is no way to get un-parsed code unless you have direct server access or else the file is permissioned and formatted to be read unparsed.

Link to comment
https://forums.phpfreaks.com/topic/122049-require-question/#findComment-630062
Share on other sites

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.