PHP Classes
elePHPant
Icontem

File: ajax_rate.php

Recommend this page to a friend!
  Classes of Subin Siby  >  Francium PHP 5 Star Rating System  >  ajax_rate.php  >  Download  
File: ajax_rate.php
Role: Example script
Content type: text/plain
Description: JavaScript sends AJAX request to this file to submit rating.
Class: Francium PHP 5 Star Rating System
Record star ratings of items in a MySQL with AJAX
Author: By
Last change:
Date: 3 years ago
Size: 287 bytes
 

Contents

Class file image Download
<?php
// This is where AJAX would sent request to

if(isset($_POST['id']) && isset($_POST['rating']) && $_POST['id'] == "index_page"){
 
session_start();
 
  require_once
__DIR__ . "/config.php";
 
$star->id = $_POST['id'];
 
$star->addRating($_SESSION['user_id'], $_POST['rating']);
}