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] Link to comment https://forums.phpfreaks.com/topic/24645-unexpected/ 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... Link to comment https://forums.phpfreaks.com/topic/24645-unexpected/#findComment-112256 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.