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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.