Event Handler
Posted: Wed Sep 21, 2005 11:00 pm
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.
and the code that calls the handler...
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'];
}
}Code: Select all
Dispatcher("testhandler", $_POST);