Jikson26 Posted June 22, 2007 Share Posted June 22, 2007 Hey guys, I'm a beginner and trying to figure out some things in php. Let's say I have a script count.php and i want it to add all the numbers generated from multiple remote files (number.php) so count.php is at domain1.com The number.php would be at domain2.com and i want count.php to get the number generated from number.php into a variable inside count.php How would I code count.php to fetch the number from the remote file (number.php)? Sorry if my word is a little confusing. but i will really appreciate anyone who try to help merci d'avance. Link to comment https://forums.phpfreaks.com/topic/56721-fetching-page-result/ Share on other sites More sharing options...
php_joe Posted June 22, 2007 Share Posted June 22, 2007 Hey guys, I'm a beginner and trying to figure out some things in php. Let's say I have a script count.php and i want it to add all the numbers generated from multiple remote files (number.php) so count.php is at domain1.com The number.php would be at domain2.com and i want count.php to get the number generated from number.php into a variable inside count.php How would I code count.php to fetch the number from the remote file (number.php)? Sorry if my word is a little confusing. but i will really appreciate anyone who try to help merci d'avance. So, assuming that domain1.com requres a variable input and will display just the number (without any other stuff) then you could do this: <? $number = file_get_contents("http://www.domain1.com?some_variable=value"); if(!is_numeric($number)) unset($number); ?> Link to comment https://forums.phpfreaks.com/topic/56721-fetching-page-result/#findComment-280164 Share on other sites More sharing options...
Jikson26 Posted June 22, 2007 Author Share Posted June 22, 2007 Yes! Thank you so much, this works like a charm. Link to comment https://forums.phpfreaks.com/topic/56721-fetching-page-result/#findComment-280180 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.