Help for this page

Select Code to Download


  1. or download this
    create table Views (
    id int(11),
    ...
    IPAddress varchar(15),
    DateAdded timestamp default current_timestamp
    )
    
  2. or download this
    if ($session_data->{'LoggedIn'}) {
        $existing_view = $db->selectall_arrayref(qq|Select DateAdded from 
    +Views where Id = ? and (IPAddress = ? or UserId = ?)|,undef,($id,$r->
    +connection->remote_ip,$userid));
    } else {
        $existing_view = $db->selectall_arrayref(qq|Select DateAdded from 
    +Views where Id = ? and IPAddress = ?|,undef,($id,$r->connection->remo
    +te_ip));
    }
    
  3. or download this
    unless (@$existing_view) {
     # get our cookie of id's
    ...
     $cookie = $id;
    }
    # set the new cookie