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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.