Jump to content


Photo

Unexpected ";"


  • Please log in to reply
1 reply to this topic

#1 Drezard

Drezard
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts

Posted 21 October 2006 - 10:26 AM

Hello i get this error:

Parse error: syntax error, unexpected ':' in /home/wintersw/public_html/class.php on line


With this code: I cant work it out:

<?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());	
	}
}	



#2 JasonLewis

JasonLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 3,351 posts
  • LocationVictoria, Australia

Posted 21 October 2006 - 11:25 AM

change your $time variable to this:

$time = date("h:i:s-m-d-y");
i have a feeling thats the error...
Good luck with your coding.
Jason / ProjectFear / Jaysonic




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users