B
Balbino Brito
Hello Everyone.
I´m trying to make a counter in my server BUT I would like to call it FROM
ANOTHER SERVER.
Let me explain this a little further:
Suppose I have a PHP-IIS Server working properly with an script called
counter.php. We´ll call this server NUMBER ONE
I want to show the counter on an HTML page that is hosted ON ANOTHER SERVER,
not mine. (I can upload the html though). We´ll call this server NUMBER TWO.
Now, I created an html page called default.htm calling the script using:
<p>
<script language="JavaScript1.2" type="text/javascript"
src="www.NUMBERONE.COM/counter.php"> </script>
</p>
And I stored the HTML file on the NUMBER TWO server.
Now, I want to open the url http://WWW.NUMBERTWO.COM/default.htm and I want
it to show the IMAGES from MY counter ON NUMBER ONE!
Now, the problem I´m having is that the counter INCREMENTS ITSELF when I
open the page, BUT IT DOESN´T SHOW THE IMAGES...
If I open HTTP://WWW.NUMBERONE.COM/COUNTER.PHP it shows all the images
properly.
Now, I´m a Newbie and I have no clue of what is going on here... Can anyone
help me???
I don´t know if the problem is in my html file or in my php script...
Help!!!
BB
<?php
include ("parameters.inf");
$vdigits = 1;
if (file_exists("$datafile")) {
$fp = fopen("$datafile", "r+");
flock($fp, 2);
$count = fgets($fp, 4096);
$count += 1;
fseek($fp,0);
fwrite($fp, $count);
flock($fp, 3);
fclose($fp);
} else {
echo "Your Counter.dat file is missing '\$file' var...<BR>";
exit;
}
$count=chop($count);
$vdigits = max(strlen($count), $vdigits);
$count = substr("0000000000".$count, -$vdigits);
$varreglo = preg_split("//", $count);
for($i = 0; $i <= $vdigits; $i++) {
if ($varreglo[$i] != "") {
echo "<IMG SRC=\"$imgdir$varreglo[$i].gif\" border=\"0\"
alt=\"$varreglo[$i]\">";
}
}
?>
I´m trying to make a counter in my server BUT I would like to call it FROM
ANOTHER SERVER.
Let me explain this a little further:
Suppose I have a PHP-IIS Server working properly with an script called
counter.php. We´ll call this server NUMBER ONE
I want to show the counter on an HTML page that is hosted ON ANOTHER SERVER,
not mine. (I can upload the html though). We´ll call this server NUMBER TWO.
Now, I created an html page called default.htm calling the script using:
<p>
<script language="JavaScript1.2" type="text/javascript"
src="www.NUMBERONE.COM/counter.php"> </script>
</p>
And I stored the HTML file on the NUMBER TWO server.
Now, I want to open the url http://WWW.NUMBERTWO.COM/default.htm and I want
it to show the IMAGES from MY counter ON NUMBER ONE!
Now, the problem I´m having is that the counter INCREMENTS ITSELF when I
open the page, BUT IT DOESN´T SHOW THE IMAGES...
If I open HTTP://WWW.NUMBERONE.COM/COUNTER.PHP it shows all the images
properly.
Now, I´m a Newbie and I have no clue of what is going on here... Can anyone
help me???
I don´t know if the problem is in my html file or in my php script...
Help!!!
BB
<?php
include ("parameters.inf");
$vdigits = 1;
if (file_exists("$datafile")) {
$fp = fopen("$datafile", "r+");
flock($fp, 2);
$count = fgets($fp, 4096);
$count += 1;
fseek($fp,0);
fwrite($fp, $count);
flock($fp, 3);
fclose($fp);
} else {
echo "Your Counter.dat file is missing '\$file' var...<BR>";
exit;
}
$count=chop($count);
$vdigits = max(strlen($count), $vdigits);
$count = substr("0000000000".$count, -$vdigits);
$varreglo = preg_split("//", $count);
for($i = 0; $i <= $vdigits; $i++) {
if ($varreglo[$i] != "") {
echo "<IMG SRC=\"$imgdir$varreglo[$i].gif\" border=\"0\"
alt=\"$varreglo[$i]\">";
}
}
?>