Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Licznik odwiedzin oparty o mysql, nie działa
imashjan
post
Post #1





Grupa: Zarejestrowani
Postów: 73
Pomógł: 0
Dołączył: 30.11.2005

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


To licznik odwiedzin
  1. <?php
  2. class LicznikDuzy extends Licznik {
  3.  
  4. private $db;
  5.  
  6. public function __construct() {
  7. parent::__construct();
  8. if(!$_COOKIE['zliczony']) {
  9. $this->db = mysql_connect('xxxxxxxxx','xxxxxxx','xxxxxx'}m');
  10. mysql_select_db('tereny_db4',$this->db);
  11.  
  12. if($_SERVER['HTTP_X_FORWARDED_FOR']) $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
  13. else $ip = $_SERVER['REMOTE_ADDR'];
  14.  
  15. $query = "INSERT INTO log(data, ip) VALUES (now(), '$ip')";
  16. mysql_query($query, $this->db);
  17. }
  18. }
  19. public function __destruct() {
  20. parent::__destruct();
  21. if($this->) {
  22. mysql_close($this->db);
  23. }}}
  24. ?>

a o to bład
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in index2.php5 on line 14

Jesli ktoś zapyta czemu jest po php5 , bo tak musi niby być żeby działało php5, bo ten skrypt jest pod php5.

Ten post edytował imashjan 12.10.2006, 22:51:27
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 24.12.2025 - 23:59