bytes Posted March 9, 2010 Share Posted March 9, 2010 Hi there. I would like to ask how can I fetch the info from another page to a page. For instance : - There is a page called index.php. I want to put the data fetched from a page called get.php Get.php contains some text. I will give some more to you all. Quote Link to comment https://forums.phpfreaks.com/topic/194623-get-info-from-another-page/ Share on other sites More sharing options...
Zane Posted March 9, 2010 Share Posted March 9, 2010 http://php.net/include Quote Link to comment https://forums.phpfreaks.com/topic/194623-get-info-from-another-page/#findComment-1023562 Share on other sites More sharing options...
bytes Posted March 9, 2010 Author Share Posted March 9, 2010 I knew include but how can I put the fetched data on my index page. Quote Link to comment https://forums.phpfreaks.com/topic/194623-get-info-from-another-page/#findComment-1023566 Share on other sites More sharing options...
Zane Posted March 9, 2010 Share Posted March 9, 2010 umm.. are you echoing the fetched data on get.php..? That would have a lot to do with it Quote Link to comment https://forums.phpfreaks.com/topic/194623-get-info-from-another-page/#findComment-1023569 Share on other sites More sharing options...
bytes Posted March 9, 2010 Author Share Posted March 9, 2010 I just want the text from get.php to appear on index page. I think it would be echoing. Quote Link to comment https://forums.phpfreaks.com/topic/194623-get-info-from-another-page/#findComment-1023575 Share on other sites More sharing options...
trq Posted March 9, 2010 Share Posted March 9, 2010 Again, use include. Quote Link to comment https://forums.phpfreaks.com/topic/194623-get-info-from-another-page/#findComment-1023596 Share on other sites More sharing options...
bytes Posted March 9, 2010 Author Share Posted March 9, 2010 Can anyone teach me how can I include it ? I know only include('get.php') Quote Link to comment https://forums.phpfreaks.com/topic/194623-get-info-from-another-page/#findComment-1023603 Share on other sites More sharing options...
trq Posted March 9, 2010 Share Posted March 9, 2010 Maybe you need to explain exactly what you want. include('get.php'); will include the output of get.php into wherever it is called. If thats not what you want, explain what it is you DO want. Quote Link to comment https://forums.phpfreaks.com/topic/194623-get-info-from-another-page/#findComment-1023607 Share on other sites More sharing options...
Zane Posted March 9, 2010 Share Posted March 9, 2010 Here, I'll break it down for you Lets say for instance... get.php contains this echo "This is get.php and blah blah blah blah blah"; and this is index.php //I want to see what is inside get.php //I guess I will include it include('get.php'); //OMG... it says the same thing as get.php does!!!! //I guess I should echo some other stuff to make index.php more... INDEXy echo "This is the index page and above this... I have included the get.php page"; Can I make it any more clearer Quote Link to comment https://forums.phpfreaks.com/topic/194623-get-info-from-another-page/#findComment-1023613 Share on other sites More sharing options...
bytes Posted March 9, 2010 Author Share Posted March 9, 2010 Sorry to disturb anyone on helping me. Thanks I solved it by using file_get_contents. Quote Link to comment https://forums.phpfreaks.com/topic/194623-get-info-from-another-page/#findComment-1023627 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.