show a text inner a html page through php, php link inner ht
Posted: Fri Feb 02, 2007 3:46 pm
hello, i have this file
and i want show the value returned by vts. i have so much pages, i would like to do something that i add in each html page like thus
"http://page.com/views.php", well, i dont know how explain, but i want domething like webstatus4u, that you add a single link and done, (others) shown the views amount.
thus
<img src="mysite.com/views.php" border=0>
but reall that dont show an image just a text (if is an image no problem, but i guess that is more work to). I can solve that including this php file in all html pages that will be not more html pages, then php pages :s, i dont want change their extentions and dont include in the page like if apache read html pages because doesnt.
who can i do that?
Code: Select all
<?
function vts(){
$fp = fopen("visitas.txt","r"); //no olvidar crear al archivo visitantes.txt y poner el path correcto
while($ip2 = fgets($fp)){
$ips=$ip2;
}
fclose($fp);
$ips=intval($ips);
$ips++;
$fp = fopen("visitas.txt","w+"); //no olvidar crear al archivo visitantes.txt y poner el path correcto
fwrite($fp, $ips);
fclose($fp);
return $ips;
}
?>"http://page.com/views.php", well, i dont know how explain, but i want domething like webstatus4u, that you add a single link and done, (others) shown the views amount.
thus
<img src="mysite.com/views.php" border=0>
but reall that dont show an image just a text (if is an image no problem, but i guess that is more work to). I can solve that including this php file in all html pages that will be not more html pages, then php pages :s, i dont want change their extentions and dont include in the page like if apache read html pages because doesnt.
who can i do that?