Drezard Posted October 21, 2006 Share Posted October 21, 2006 Hello i get this error:[QUOTE]Parse error: syntax error, unexpected ':' in /home/wintersw/public_html/class.php on line [/QUOTE]With this code: I cant work it out:[CODE]<?php session_start(); error_reporting(E_ALL); class web { public $page; function get_ip() { $ip = trim($_SERVER['REMOTE_ADDR']); return $ip; } function connect() { $user = "wintersw_drezard"; $pass = "250291"; $host = "localhost"; $db = "wintersw_wintersword"; $connect = mysql_connect($host, $user, $pass) or die ("Error: Unable to connect to MySql"); mysql_select_db($db) or die ("Error: Unable to select MySql database"); } function log_time() { $time = date(h:i:s-m-d-y); return $time; } function log_timeip() { $time = $this->log_time(); $ip = $this->get_ip(); $this->connect(); $query = "INSERT INTO ip_viewlog(ip, time) VALUES ('$ip', '$time')"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); }} [/CODE] Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted October 21, 2006 Share Posted October 21, 2006 change your $time variable to this:[code=php:0]$time = date("h:i:s-m-d-y");[/code]i have a feeling thats the error... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.