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. 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 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. 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 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. 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. 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') 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. 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 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. 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
Archived
This topic is now archived and is closed to further replies.