PHP Classes

File: grid.php

Recommend this page to a friend!
  Classes of Er. Rochak Chauhan   AJAX Grid   grid.php   Download  
File: grid.php
Role: Auxiliary script
Content type: text/plain
Description: File to update grid in realtime
Class: AJAX Grid
Edit and save table data without page refreshing
Author: By
Last change:
Date: 18 years ago
Size: 795 bytes
 

Contents

Class file image Download
<?php
   
    $content
= '';
   
$id = $_GET['spanId'];
       
    switch (
$id) {
       
        case
'r1c1':
               
$content = file_get_contents('Row1Col1.txt', 'r') or die("Failed to read from : Row1Col1.txt");
                echo
$content;
            break;
       
        case
'r1c2':
               
$content = file_get_contents('Row1Col2.txt', 'r') or die("Failed to read from : Row1Col2.txt");
                echo
$content;
            break;
       
        case
'r2c1':
               
$content = file_get_contents('Row2Col1.txt', 'r') or die("Failed to read from : Row2Col1.txt");
                echo
$content;
            break;
       
        case
'r2c2':
               
$content = file_get_contents('Row2Col2.txt', 'r') or die("Failed to read from : Row2Col2.txt");
                echo
$content;
            break;
       
        default;
            die (
"Uncaught exception in ".__FILE__." at ".__LINE__);
    }
?>