[elektro-etc] php gond (az atw.hu-n)
lista mail
jappofan at gmail.com
Fri Sep 4 09:36:48 CEST 2015
Miért kéne...?!
Az index.php-be elég ennyi is... >> hullozoo.hu
Ez egy adott div elembe írja ki a számot.
A hivatkozott szam.txt persze kell, hogy létezzen és írható is kell legyen.
--------------------------------------------
<div class="latogato">
<?php
function szamlalo( $nev ) // az allomany nevet
parameterkent kapja
{
if (file_exists($nev))
{
$ALLOMANY = fopen($nev,"r");
$szam = fgets($ALLOMANY);
fclose($ALLOMANY);
}
else
{
$szam = 0;
}
$szam = $szam + 1;
$ALLOMANY = fopen($nev, "w");
fputs($ALLOMANY, $szam);
fclose($ALLOMANY);
return $szam; // a szamlalo erteket vissza adja
}
echo "Látogató: " . szamlalo( "szam.txt" ) . "";
?>
</div>
--------------------------------------
A div tulajdonságait nyilván a hozzátartozó CSS adja meg....
.latogato {border: 0px solid #87b1c7;
margin: 7px 0px 0px 0px;
padding: 7px 7px 7px 7px;
font-family:Arial,sans-serif;
text-align:center;
background-color:#15317E;
font-size: 12px;
font-weight: bold;
color: #ffffff;}
2015. szeptember 4. 9:28 Cser Tamas írta, <maguspr53 at gmail.com>:
> Alaksza Balázs <elektro at infoskacatok.hu> írta, 2015. 09. 04.:
> > 2015.09.04. 9:03 keltezéssel, Cser Tamas írta:
> >> adott egy
> >> http://users.atw.hu/maguspr53/index.html
> >>
> >> ennek a belében van egy PHP-s "számláló" de nem írja ki az értéket
> >> miért?
> >>
> >> <?php include("http://users.atw.hu/maguspr53/counter.php"); ?>
> >>
> >> és van
> >>
> >> http://users.atw.hu/maguspr53/counter.txt
> >
> >
> > index.html-t nevezd át index.php-ra
> >
>
> Warning: include() [function.include]: URL file-access is disabled in
> the server configuration in /index.php on line 8
>
> Warning: include(http://users.atw.hu/maguspr53/counter.php)
> [function.include]: failed to open stream: no suitable wrapper could
> be found in /index.php on line 8
>
> Warning: include() [function.include]: Failed opening
> 'http://users.atw.hu/maguspr53/counter.php' for inclusion
> (include_path='.:/usr/local/lib/php') in /index.php on line 8
>
> tehát ki kell másolnom a weblapra a fél linuxot is?
> >
> > --
> > Alaksza Balázs
> >
> >
>
>
More information about the Elektro-etc
mailing list