Jump to content

fetching page result


Jikson26

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.