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. Link to comment https://forums.phpfreaks.com/topic/48653-really-stupid-question-about-print/ 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 Link to comment https://forums.phpfreaks.com/topic/48653-really-stupid-question-about-print/#findComment-238271 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! Link to comment https://forums.phpfreaks.com/topic/48653-really-stupid-question-about-print/#findComment-238410 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) Link to comment https://forums.phpfreaks.com/topic/48653-really-stupid-question-about-print/#findComment-238416 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()' ? Link to comment https://forums.phpfreaks.com/topic/48653-really-stupid-question-about-print/#findComment-238448 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 Link to comment https://forums.phpfreaks.com/topic/48653-really-stupid-question-about-print/#findComment-238799 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.