Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/example_cart_data.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Enéas Gesing  >  AJAX Wrapper  >  examples/example_cart_data.php  >  Download  
File: examples/example_cart_data.php
Role: Example script
Content type: text/plain
Description: Simple Cart Example Request
Class: AJAX Wrapper
Implement AJAX functionality using Scriptaculous
Author: By
Last change: Add comment
Date: 7 years ago
Size: 701 bytes
 

Contents

Class file image Download
<?php

include "../Ajax.php";
$ajax = new Ajax();

$id $_POST['id'];

// Using this id you can do many things. You can interact with your 
// database or with your session here. I simple switched it and show a 
// phrase according to id

switch ($id){
    case 
'cell1':
        
$name 'Black Cell Phone';
        break;
    case 
'cell2':
        
$name 'White Cell Phone';
        break;
    case 
'cell3':
        
$name 'Motorola Cell Phone';
        break;
}

$content =  '<img src="../image/'.$id.'.png" width="20" height="30"> '.$name.'<br>';

$script =
"<script type='text/javascript'>
    $('"
.$id."').style.visibility = 'hidden';
    new Insertion.After('list', '"
.$content."');
</script>"
;

echo 
$script;
?>