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. Quote Link to comment 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); ?> Quote Link to comment 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. Quote Link to comment 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.