You can't pass a PHP object through an HTML form. HTML can submit text or binary files. If you have an object already in existence that you'd like to persist across multiple pages, store it in a session variable.
You can also serialize the object into a string and unserialize it back into an object by using hidden form fields, but this serialization/unserialization process is how PHP would store and retrieve the object in your session data file anyway...
One warning, though -- if you store an object in a session var, the object's class must be defined BEFORE you call session_start() so that PHP knows what the object's name and structure are:
<?php // MyClass.php
class MyClass
{
var $foo;
function MyClass() { $this->foo = "Hello, world."; }
function out() { echo $this->foo; }
}
?>
<?php // your_script.php
require('myClass.php'); // parse class definition
session_start(); // BEFORE session_start()
...
?>
Take care,
Nik
http://www.bigaction.org/