Jump to content

Unexpected ";"


Drezard

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.