<b>REGISTER</b>

GFX-Sector - PHP und MySQL Tutorials


 
GFX-Sector » Coding Area » Coding-Tutorials » PHP und MySQL Tutorials » [PHP/MySQL] [PHP] Einfacher PHP Counter [Anfänger] » Hello Guest [Login|Register]
Last Post | First Unread Post Print Page | Recommend to a Friend | Add Thread to Favorites

PHP und MySQL Tutorials

Tutorials über die serverseitige Programmierung mit PHP und der Datenbank MySQL
Post New Thread Post Reply

[PHP] Einfacher PHP Counter [Anfänger]

     Deutsche Version  English version
Author
Post « Previous Thread | Next Thread »

ezer0
gesperrt
ezer0 hat kein Avatar

Registration Date: 01.12.2006
Posts: 379
Program: Adobe Photoshop CS2

Spacer
[PHP] Einfacher PHP Counter [Anfänger]

[PHP] Einfacher PHP Counter [Anfänger]

      

Hi @all,

Ihr wollt einen einfachen PHP Counter, dann habe ich hier ein Tut:

Zuerst brauchen wir eine .php Datei. (Die kriegt man in dem man ein Textdokument ?ffnet und die Endung .txt in .php ?ndert!)

In die .php Datei kommt dieser PHP Code:

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
<?php
$dateiname = "counter.txt";
$oeffnen = fopen ("$dateiname", "r");
while (!feof($oeffnen))
{
$lesen = fgets($oeffnen, 100);
}
fclose ($oeffnen);
$erhoeht = $lesen+1;
$schreiben = fopen($dateiname,"w");
fputs($schreiben,"$erhoeht");
fclose($schreiben);
$datei = fopen($dateiname, "r");
fpassthru($datei);
?>


Jetzt brauchen wir eine .txt Datei. In die .txt Datei schreiben wir eine 0 (Null).

Jetzt laden wir beide Dateien auf den Server hoch. Jetzt ruft man im Browser die .txt Datei auf, und dort sieht man die anzahl der Besucher die auf der Website waren.

Die .txt Datei muss man nur noch in die Website inbinden. Das geht durch eine IFrame.

Ich hoffe man versteht das Wink . Bei Fragen bitte eine PN an mich schicken!

ezer0



Thanks for this thread by the author

Until now 0 users have thanked

This post has been edited 1 time(s), it was last edited by ezer0: 02.12.2006 09:51.

[PHP] Einfacher PHP Counter [Anfänger] 02.12.2006 09:42 ezer0 is offline Search for Posts by ezer0
 
Spacer
   
GFX-Sector
unregistered


 hat kein Avatar


Spacer

Have you enjoyed this topic?


If you were enjoying this post and if you keen on reading more interesting stuff then do not hesitate to complete the free sign up.

After the free registration you will gain access to all areas and you will be able to communicate with other artists from all over the world.

In addition you will benefit from our Photoshop and coding section as well as from our huge (hundreds of gigabytes) free resource section where you can find everything you will need to be a successful (web) designer/artist.

Sign up now and enjoy the advantages as a registered member.

(This website will be ad-free after a complete free sign up.)

New Post 02.12.2006 09:42  
Tree Structure | Board Structure
Post New Thread Post Reply
GFX-Sector » Coding Area » Coding-Tutorials » PHP und MySQL Tutorials » [PHP/MySQL] [PHP] Einfacher PHP Counter [Anfänger]

Similar topics to [PHP] Einfacher PHP Counter [Anfänger]
Thread
Counter-Strike Wallpaper (Forum: Wallpaper)
Form überprüfen PHP (Forum: PHP, MySQL)
[S] Radio Design für PHP-Fusion (Forum: Entgeltliche Grafikanfragen)
[MySQL+PHP] Anzahl der Daten auslesen (Forum: PHP, MySQL)
[Anfänger] zwei mal zwei ist neune, widde widde wit macht sechse | sigs zum feeden ginge auch ._. (Forum: Signaturen/Avatare)