View Single Post
  #1 (permalink)  
Old February 14th, 2016, 12:48 AM
redfox redfox is offline
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2016
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to set php variable value from external site

I am a PHP novice and would appreciate some advice on how to achieve the following.

At hypothetical location "no_name_site.com/.count", the file .count contains a numeric string only, for example, 123. The content constantly increments. I want to display the current count at my own web page.

Something like this:


<html>
<?php
$foreign_count = {the current value stored at "no_name_site.com/.count"}
?>
<body>
<center>
<h1>Foreign Site Count</h1>
<p>count = <?php echo $foreign_count; ?></p>
</center>
</body>
</html>

Is this possible in PHP ?
Reply With Quote