Page 1 of 1

Event Handler

Posted: Wed Sep 21, 2005 11:00 pm
by jwalsh
I'm planning on building an event handler shortly, and have a question about passing arguments to the handler... Here's an example of what I would like to do... How can I pass the $_POST array as an argument, this doesn't seem to be working.

The test right now has a name field, which is posted to the page, then passed through the dispatch using the $_POST as an array argument for the field. The following code echo's nothing.

Code: Select all

function Dispatcher($event, $data) {
	// GRAB AN EVENT AND PROCESS THE DATA
	switch ($event) {
		case "testhandler":
			// USER ENTERED FIRST AND LAST NAME
			
			echo $data['name'];

	}
}
and the code that calls the handler...

Code: Select all

Dispatcher("testhandler", $_POST);