Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> licznik - problem z ciasteczkiem
froth
post
Post #1





Grupa: Zarejestrowani
Postów: 37
Pomógł: 0
Dołączył: 24.02.2004

Ostrzeżenie: (0%)
-----


mam liicznik:
<?php
setcookie("visited", "1", time()+3600*3);

?>
<head>
<html>

pozniej jest:
<?
if(file_exists("counter.n"))
{
$file=fopen("counter.n", "r");
flock($file, 1);

$ile=fgets($file, 100);

flock($file, 3);
fclose($file);

if($_COOKIE['visited']!="1")

{
$ile++;

}
}
else
{
$ile=1;
}

$file=fopen("counter.n", "w");
flock($file, 2);

fwrite($file, $ile);

flock($file, 3);
fclose($file);

echo($ile);

?>
a w rezulatcie wysxkakuje mi:
Warning: Cannot modify header information - headers already sent by (output started at /home/www/rox/index.php:4) in /home/www/rox/index.php on line 5
na samej gorze strony.Licznik dziala tylko nie jest orporny na odswiezanie.

?>[/php]
Go to the top of the page
+Quote Post

Posty w temacie
- froth   licznik - problem z ciasteczkiem   2.03.2004, 17:22:18
- - seaquest   ekhm   2.03.2004, 17:29:48
- - froth   ehhh bylo   2.03.2004, 17:31:53
- - seaquest   nie   2.03.2004, 17:33:15
- - Jabol   no więc tak. Proszę ten post wyedytować, a do tego...   2.03.2004, 17:40:14
- - froth   :))   2.03.2004, 18:06:53
- - BzikOS   Re: :))   2.03.2004, 18:18:05
- - Jabol   Re: :))   2.03.2004, 18:20:33


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 22:24