dj-kenpo Posted May 17, 2007 Share Posted May 17, 2007 I'd like to include a file but the include command won't work cross server (not on my server anyways) and I just want the rendered html anyways. is there a way that I can grab the html and output? I'd liek to avoid curl as it's a high traffic site and I imagine it eats more cpu. basicly I want to create a file pointer eg page.php <? $Get_string = $_SERVER['QUERY_STRING']; include("example.com/user_pages/page.php?$Get_string"); ?> except obviously the above doesn't work as include hates get variables. any help loved. Link to comment https://forums.phpfreaks.com/topic/51765-solved-alternative-to-include/ Share on other sites More sharing options...
cmgmyr Posted May 17, 2007 Share Posted May 17, 2007 you could use "header" and just re-direct to that page Link to comment https://forums.phpfreaks.com/topic/51765-solved-alternative-to-include/#findComment-255018 Share on other sites More sharing options...
dj-kenpo Posted May 17, 2007 Author Share Posted May 17, 2007 no, I need the person to stay in their local directory and not get transfered elsewhere. but it was a good idea. mysite.com/page.php grabs example.com/user_pages/page.php but no one knows it occured. I don't want to have to update the same file 600 times for different members. nor do I want the file space issues. easier to just refrence the same file with a sort of shortcut. make sense? at all...? Link to comment https://forums.phpfreaks.com/topic/51765-solved-alternative-to-include/#findComment-255022 Share on other sites More sharing options...
cmgmyr Posted May 17, 2007 Share Posted May 17, 2007 you could add it to a session or a cookie then when you include the file it will grab the session data Link to comment https://forums.phpfreaks.com/topic/51765-solved-alternative-to-include/#findComment-255028 Share on other sites More sharing options...
travelerBT Posted May 17, 2007 Share Posted May 17, 2007 try the file_get_content, reads the file into a string, and you can spit it out. http://us.php.net/manual/en/function.file-get-contents.php good luck! Link to comment https://forums.phpfreaks.com/topic/51765-solved-alternative-to-include/#findComment-255029 Share on other sites More sharing options...
dj-kenpo Posted May 17, 2007 Author Share Posted May 17, 2007 file_get_contents seemed like a great idea, I'm on dreamhost and got this "URL file-access is disabled in the server configuration" anything else I can do? Link to comment https://forums.phpfreaks.com/topic/51765-solved-alternative-to-include/#findComment-255426 Share on other sites More sharing options...
Orio Posted May 17, 2007 Share Posted May 17, 2007 Use the cURL library. Orio. Link to comment https://forums.phpfreaks.com/topic/51765-solved-alternative-to-include/#findComment-255431 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.