PHP Classes

File: process.php

Recommend this page to a friend!
  Classes of Gianluca Zanferrari   zquery   process.php   Download  
File: process.php
Role: Example script
Content type: text/plain
Description: processing
Class: zquery
Process interaction requests using jQuery
Author: By
Last change: improvements and new features
Date: 14 years ago
Size: 1,236 bytes
 

Contents

Class file image Download
<? session_start();
require_once(
'inc.zquery.class.php');

$zq = new zquery;

// I want to see some debug
$zq->zdebug_onoff(TRUE);

if(
$_GET && !isset($_POST['postit']))
{
   
   
// dumps the $_GET data to screen
   
$zq->zok('Data you sent:<pre>'.print_r($_GET,true).'</pre>');
   
}

if((empty(
$_POST['email']) || empty($_POST['name' ])) && isset($_POST['postit']))
{

   
// dumps the $_POST data to screen as error and an error message
   
$zq->zerr('Name: ' . $_POST['name' ] . '<br />E-mail: ' . $_POST['email'] . '<br /> Please fill both in: your e-mail address and name.');
   
}
elseif(! empty(
$_POST['email']) && ! empty($_POST['name' ]) && isset($_POST['postit']))
{
   
   
// dumps to screen the $_POST data and a thanks message
   
$zq->zok('Name: ' . $_POST['name' ] . '<br />E-mail: ' . $_POST['email'] . '<br />Thanks, you are suscribed!');
   
// remove the subscribe button
   
$zq->zjq('$("#subx").fadeOut("slow");');
   
// show an alert
   
$zq->zjq('$( function() { alert("The subscribe button will be removed!"); } );');
   
// now we display de data through another file (showdata.php)
   
$zq->zload('showdata.php?name='.stripslashes($_POST['name' ]).'&e-mail='.stripslashes($_POST['email' ]).'','zqDisplay');
   
}
?>