DarthMonkey Posted April 25, 2007 Share Posted April 25, 2007 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. Quote Link to comment Share on other sites More sharing options...
dsaba Posted April 25, 2007 Share Posted April 25, 2007 echo file_get_contents('script.php'); (heee, hee, haaa, haaa) the donkey laughed not me Quote Link to comment Share on other sites More sharing options...
DarthMonkey Posted April 25, 2007 Author Share Posted April 25, 2007 THAT'S IT! Argh, I may be a PHP noob, but that's still embarrassing. Thanks for the help! Quote Link to comment Share on other sites More sharing options...
ataria Posted April 25, 2007 Share Posted April 25, 2007 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) Quote Link to comment Share on other sites More sharing options...
DarthMonkey Posted April 25, 2007 Author Share Posted April 25, 2007 Well, it works. But now I need to figure out how to make the words wrap. It just goes on and on indefinitely, but I need it to wrap at, say 500 pixels or something. How do I do that for 'echo file_get_contents()' ? Quote Link to comment Share on other sites More sharing options...
dsaba Posted April 26, 2007 Share Posted April 26, 2007 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 Quote Link to comment 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.