topical media & game development
professional-ajax-10-JPSpan-Demo-CustomerServer-JPSpan.php / php
<?php
class Customer
{
//Business class to be included here
public function getAddressFromEmail(address = array("success" => FALSE);
dbPath = realpath('sales.mdb');
//dbPath';";
//Connection details for SQL Server database
conn->connectionString = conn->open();
email);
conn->execute("SELECT * FROM tblCustomer WHERE Email = 'rs->EOF)
{
address['forenames'] = address['surname'] = address['address1'] = address['address2'] = address['address3'] = address['addressTown'] = address['addressStateCounty'] = address['addressZipPC'] = address['addressCountry'] = rs->close();
address;
}
}
// Including this sets up the JPSPAN constant
require_once '../JPSpan/JPSpan.php';
// Load the PostOffice server
require_once JPSPAN . 'Server/PostOffice.php';
// Create the PostOffice server
PostOffice->addHandler(new Customer());
// This allows the JavaScript to be seen by
// just adding ?client to the end of the
// server's URL
if (isset(_SERVER['QUERY_STRING'], 'client') == 0)
{
// Compress the output Javascript feature (e.g. strip whitespace)
// turn this off it has performance problems
define('JPSPAN_INCLUDE_COMPRESS', false);
// Display the Javascript client
PostOffice->serve();
}
?>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.