Jump to content

Really stupid question about print()


DarthMonkey

Recommended Posts

Don't laugh at me. I know... well, knew how to do this. Not anymore...

 

So I have my index.php and a seperate script.php that I want to run, and print the results of, on index.php. If I remember right, it's something really stupid and simple like print(script.php). Only problem is... That's apparently not it, and I don't know what is.

Link to comment
https://forums.phpfreaks.com/topic/48653-really-stupid-question-about-print/
Share on other sites

Off Topic, but, question..

echo file_get_contents('script.php');

 

would that do the same as, include or require?

(Sorry, just trying to find a connection between them, if there is one)

 

Yes and No ataria

if you file_get_contents() from a file in you root directory

like www/home/website/file.php

 

it will retrieve the source code if owner has permissions to read write and execute

 

if you file_get_contents() from a remote hosted file like http://website/file.php

it will show the html output since remote connections on php files cannot show the source code of the file

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.