Thursday, July 24, 2008
Home | Benchmarks | Documentation | Samples | FAQ | Links | Download
search php-soap for  


Samples

4. Session

 

Description:

 
  This example shows how you can use PHP's default session handling to use session variables per SoapObject.

 
 

Client:  session-client.php

 
 

<?
$session
= new SoapObject("http://www.yourserver.com/session.php", "urn:Session");
echo
$session->inc() . "\n";
echo
$session->inc() . "\n";
echo
$session->inc() . "\n";
?>
1


 
 

Server:  session-server.php

 
 

<?
$server
= new SoapObject("urn:Session");
$server->addFunction("inc");
$server->handle();

function
inc()
{
    
/* assuming register_globals is on */
    
session_register("counter");
    global
$counter;

    return
$counter++;
}
?>
1


 
blue | green | yellow | grey
SourceForge Logo
Go to the main PHP site