Login   Register  
PHP Classes
elePHPant
Icontem

File: example1b_confirm.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Manish Khanchandani  >  Reviews  >  example1b_confirm.php  >  Download  
File: example1b_confirm.php
Role: Example script
Content type: text/plain
Description: Example
Class: Reviews
Store and retrieve reviews of products in MySQL
Author: By
Last change:
Date: 5 years ago
Size: 1,012 bytes
 

Contents

Class file image Download
<?php
if(isset($_GET['confirm'])) {
    try {
        
// including rating class
        
include_once('Xoriant_Reviews.php');
        
$Reviews = new Xoriant_Reviews();
        
$data['item_id'] = $_GET['item_id'];
        
$data['rating_id'] = $_GET['rating_id'];
        
$data['confirm_user_id'] = 1;
        
$data['confirm'] = $_GET['confirm'];
        
$data['confirm_ip'] = $_SERVER['REMOTE_ADDR'];
        
$data['uniqueip'] = 0;
        
$data['uniqueuser'] = 0;
        
$data['confirm_date'] = date('Y-m-d H:i:s');
        if(
$data['uniqueip']=="1") {
            
$count $Reviews->checkConfirmUniqueIp($data);
            if(
$count>0) throw new Exception("Duplicate Ip");
        }
        if(
$data['uniqueuser']=="1") {
            
$count $Reviews->checkConfirmUniqueUser($data);
            if(
$count>0) throw new Exception("Duplicate User");
        }
        
$confirm_rating_id $Reviews->phpinsert('xoriant_reviews_ratings_confirm''confirm_rating_id'$data);
        
header("Location: example1b.php?item_id=".$_GET['item_id']);
        exit;
    } catch (
exception $e) { 
        
$errorMessage $e->getMessage();
        echo 
$message $errorMessage;
    }
}
?>