---
title: "Räknare, problem med rättigheter?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/php/49806-räknare-problem-med-rättigheter"
topic: "PHP"
topic_url: "https://www.webforum.nu/amne/php"
author: "Simpa"
published: "2002-08-08T16:50:08.000Z"
updated: "2002-08-08T19:31:50.000Z"
replies: 12
views: 348
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/php/49806-räknare-problem-med-rättigheter"
---

# Räknare, problem med rättigheter?

## #1 — Simpa, 2002-08-08T16:50Z

Har lagt in följande script...

\<?PHP

$fp = fopen ("e:/www/www.simpa.se/datacounter.txt", "w+");
$file = "e:/www/www.simpa.se/data/counter.txt";
$antal = implode('', file($file));
$antal++;
fwrite($open, $antal);
echo " $antal " ; 
fclose($fp);

?\>
men får.. 

Warning: fopen("e:/www/www.simpa.se/datacounter.txt", "w+") - Permission denied in e:\\www\\www.simpa.se\\www\\php\\testa\\raknare.php on line 3

Notice: Undefined variable: open in e:\\www\\www.simpa.se\\www\\php\\testa\\raknare.php on line 7

Warning: fwrite(): supplied argument is not a valid File-Handle resource in e:\\www\\www.simpa.se\\www\\php\\testa\\raknare.php on line 7
3 
Warning: fclose(): supplied argument is not a valid File-Handle resource in e:\\www\\www.simpa.se\\www\\php\\testa\\raknare.php on line 9

Det ska inte vara något problem med rättigheterna, har webbhotelet på aleborg.com , aleborg kan intyga det :)

\*ropar på aleborg\*

Permalänk: https://www.webforum.nu/p/49806

## #2 — aleborg, 2002-08-08T16:55Z

Skrivrättigheter i mappen "data"(ej tillgänglig utifrån) samt mappen "php"

Permalänk: https://www.webforum.nu/p/746320

## #3 — Simpa, 2002-08-08T17:18Z

Undra om det beror på att jag missade en / !

Permalänk: https://www.webforum.nu/p/746348

## #4 — Simpa, 2002-08-08T17:20Z

wee
nu fick jag ett annat fel istället :D

Notice: Undefined variable: open in e:\\www\\www.simpa.se\\www\\php\\testa\\raknare.php on line 7

Warning: fwrite(): supplied argument is not a valid File-Handle resource in e:\\www\\www.simpa.se\\www\\php\\testa\\raknare.php on line 7
1 

nån som vet?

Permalänk: https://www.webforum.nu/p/746351

## #5 — Simpa, 2002-08-08T17:25Z

Döpt variblen fel...

varför går inte jag igenom inna jag frågar.. \*slår på mej själv\*

Permalänk: https://www.webforum.nu/p/746355

## #6 — Simpa, 2002-08-08T17:42Z

<http://simpa.aleborg.com/php/testa/raknare.php>

Sådär min första räknare :D 

iofs inte unika besökare men men ;)

Permalänk: https://www.webforum.nu/p/746369

## #7 — flat-eric, 2002-08-08T18:20Z

Humm! Tittade för 15 minuter sedan. Då visade den 44. Nu är den på 390. :o

Permalänk: https://www.webforum.nu/p/746393

## #8 — Simpa, 2002-08-08T18:33Z

:) :) 

 aleborg, den galna floodaren ;)

Permalänk: https://www.webforum.nu/p/746404

## #9 — Simpa, 2002-08-08T18:34Z

Försöker få till coockie protection, men det var lite klurigare än jag trodde ;)

Får se om jag lyckas på min egen hand först innan jag frågar..

Permalänk: https://www.webforum.nu/p/746405

## #10 — Simpa, 2002-08-08T19:01Z

problem igen.. 

```php
<?php 
setcookie ("CountCookie", $CountCoockie, time() + 1800);   

$antal = implode('', file($file)); 

if (isset ($CountCookie)) { 
    echo " $antal "; 
} else { 
    $fp = fopen ("e:/www/www.simpa.se/data/counter.txt", "r+"); 
    $file = "e:/www/www.simpa.se/data/counter.txt"; 
    $antal++; 
    fwrite($fp, $antal); 
    echo " Räknare: <b> $antal </b> " ;  
    fclose($fp); 
} 
 

?>
```

 

Får följande fel.. 

```
Notice: Undefined variable: CountCoockie in e:\www\[url]www.simpa.se\www\php\testa\raknare1.php[/url] on line 2

Warning: Cannot add header information - headers already sent by (output started at e:\www\[url]www.simpa.se\www\php\testa\raknare1.php:2[/url]) in e:\www\[url]www.simpa.se\www\php\testa\raknare1.php[/url] on line 2

Notice: Undefined variable: file in e:\www\[url]www.simpa.se\www\php\testa\raknare1.php[/url] on line 4

Warning: file("") - No error in e:\www\[url]www.simpa.se\www\php\testa\raknare1.php[/url] on line 4

Warning: Bad arguments to implode() in e:\www\[url]www.simpa.se\www\php\testa\raknare1.php[/url] on line 4
Räknare: 1
```

Permalänk: https://www.webforum.nu/p/746424

## #11 — netfeed, 2002-08-08T19:11Z

jag får detta fel när jag tittar på sidan:

```
Parse error: parse error, unexpected '}', expecting ',' or ';' in e:\www\[url]www.simpa.se\www\php\testa\raknare.php[/url] on line 16
```

Permalänk: https://www.webforum.nu/p/746428

## #12 — SPiN, 2002-08-08T19:22Z

```
<?php    
$file = "e:/www/www.simpa.se/data/counter.txt";

$antal = ( int ) implode('', file($file)); 

if (isset ($_COOKIE[ 'CountCookie' ]) && $_COOKIE[ 'CountCookie' ] != "") { 
    echo " $antal "; 
} else { 
    setcookie ("CountCookie", "CountCookie", time() + 1800);
    $fp = fopen ($file, "r+"); 
    $antal++;
    fwrite($fp, $antal);

    echo " Räknare: <b> $antal </b> " ;

    fclose($fp); 
}
```

Kanske?

Permalänk: https://www.webforum.nu/p/746435

## #13 — Simpa, 2002-08-08T19:31Z

Tack Tack , nu har det löst sej :)

Permalänk: https://www.webforum.nu/p/746440

---

Tråden på webben: https://www.webforum.nu/amne/php/49806-räknare-problem-med-rättigheter
