Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.php > #4619
| From | Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) |
|---|---|
| Newsgroups | de.comm.infosystems.www.authoring.misc, de.comp.lang.php |
| Subject | Re: Umstellung auf PHP |
| Followup-To | de.comp.lang.php |
| Date | 2020-11-03 11:41 +0000 |
| Message-ID | <3t5fa14058i62edn3e8%sfroehli@Froehlich.Priv.at> (permalink) |
| References | <16rz688fjy84u$.dlg@wolfgang-bauer.at> |
Cross-posted to 2 groups.
Followups directed to: de.comp.lang.php
Xpost und Fup nach dclp
On Tue, 03 Nov 2020 12:22:36 Wolfgang Bauer wrote:
> <?php
> echo "<!DOCTYPE html>\n";
> echo "<html lang=\"de\">\n";
> echo "\n";
> echo "<head>\n";
> echo " <title>Wolfgang Bauer, meine private Startseite</title>\n";
> echo " <link href=\"styles.css\" rel=\"stylesheet\" type=\"text/css\" /> \n";
> echo " <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"images/favicon.ico\">\n";
> echo " <meta name=\"description\" content=\"Meine Kurzbiographie und Bilder meiner Umgebung\" />\n";
> echo " <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n";
> echo " \n";
> echo "\n";
> echo " \n";
Tip: Solange Du einfach nur Text 1:1 ausgibst, ist es einfacher, den
direkt in den Quelltext zu schreiben, anstatt ihn via echo
auszugeben:
#v+
<!DOCTYPE html>
<html lang="de">
<head>
<title>Wolfgang Bauer, meine private Startseite</title>
[...]
<?php # hier kommt eine PHP-generierte ausgabe ?>
#v-
> <? function getCounter($counterID)
> {
> // each counter value is stored inside a unique file
> // We use $counterID as a part of the file name
> // Example: file name will be "counter1.txt" if $counterID is set to "1"
>
> $fileName = "counter".$counterID.".txt";
>
> if( file_exists($fileName) ) {
> list($numVisitors)=file($fileName); // Read contents from the file
> } else {
> $numVisitors=0; // This is the first time the page is accessed
> }
>
> $numVisitors=$numVisitors+1; // Increase the count
>
> $fil=fopen($fileName,"w"); // Open the file to replace old value
> fputs($fil,$numVisitors); // Write the new count to the file
> fclose($fil); // Close the file
> return $numVisitors; // Return the new count
> }
> ?>
> Der, wenn ich selbst die Site aufrufe, aber immer auf 1 steht.
Hast Du denn überhaupt Schreibrechte in dem Verzeichnis? Das sieht
mir auf den ersten Blick sehr danach aus, als ob jedes Mal
$numVisitors mit 0 initialisiert, hochgezählt, angezeigt aber danach
nicht gespeichert wird.
(Über die Sinnhaftigkeit von Countern lasse ich mich an dieser
Stelle nicht aus)
Servus,
Stefan
--
http://kontaktinser.at/ - die kostenlose Kontaktboerse fuer Oesterreich
Offizieller Erstbesucher(TM) von mmeike
Das Glück kommt zu dir. Mit Stefan. Ein geniales Vergnügen!
(Sloganizer)
Back to de.comp.lang.php | Previous | Next — Next in thread | Find similar
Re: Umstellung auf PHP Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2020-11-03 11:41 +0000
Re: Umstellung auf PHP Wolfgang Bauer <wolfgang-bauer@gmx.eu> - 2020-11-03 13:07 +0100
Re: Umstellung auf PHP Wolfgang Bauer <wolfgang-bauer@gmx.eu> - 2020-11-03 13:22 +0100
Re: Umstellung auf PHP Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2020-11-03 13:25 +0000
Re: Umstellung auf PHP Wolfgang Bauer <wolfgang-bauer@gmx.eu> - 2020-11-03 15:17 +0100
Re: Umstellung auf PHP Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2020-11-03 14:44 +0000
Re: Umstellung auf PHP Wolfgang Bauer <wolfgang-bauer@gmx.eu> - 2020-11-03 16:05 +0100
Re: Umstellung auf PHP Wolfgang Bauer <wolfgang-bauer@gmx.eu> - 2020-11-08 11:49 +0100
Re: Umstellung auf PHP Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2020-11-08 13:15 +0000
Re: Umstellung auf PHP Wolfgang Bauer <wolfgang-bauer@gmx.eu> - 2020-11-08 15:40 +0100
csiph-web