By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,615 Members | 1,961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,615 IT Pros & Developers. It's quick & easy.

Event driven handler in PHP

P: n/a
I am fairly new to PHP. I started creating a variety of classes
(calendars, input forms, combo boxes, etc. ) but I am running into code
overhead when I integrate these objects (testing for POST, GETS,
Cookies etc.).

I am looking for an interrupt driven approach to handle event
processing (akin to VB's GUI) to simplify interactions. Basically, I
would like to create the objects to be displayed on the pages and then
activate a page event handler to process ithe inputs. Currently I am
using a mix of js, php and session cookies. But I don't like this
hybrid approach.

AFIK, PHP does not natively support event interrupt handling. Is there
somewhere an add-on or a more elegant work-around to handle such
situations?

I read about Ajax, XML and related technologies. Is this the path to
go? Thanks for any pointers and/or advice.

Mark

Jun 19 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ms******@bluewin.ch wrote:
I am fairly new to PHP. I started creating a variety of classes
(calendars, input forms, combo boxes, etc. ) but I am running into code
overhead when I integrate these objects (testing for POST, GETS,
Cookies etc.).

I am looking for an interrupt driven approach to handle event
processing (akin to VB's GUI) to simplify interactions. Basically, I
would like to create the objects to be displayed on the pages and then
activate a page event handler to process ithe inputs. Currently I am
using a mix of js, php and session cookies. But I don't like this
hybrid approach.

AFIK, PHP does not natively support event interrupt handling. Is there
somewhere an add-on or a more elegant work-around to handle such
situations?

I read about Ajax, XML and related technologies. Is this the path to
go? Thanks for any pointers and/or advice.

Mark


No, PHP doesn't support interrupt handling - but there's no need to.

The php runs and builds the page. The code then sends the page to the browser
and terminates. When you send input from the browser, a new process or thread
is started to handle the input.

One problem you will have is you can't "display an object" on a page. You can
only write attributes to the page. So you have no object to return to the script.

You could store the object in the $_SESSION and retrieve it later.

But you really need to think in a different way. This is not VB, where you have
one program running all the time. This is transactional - and is handled
differently.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 20 '06 #2

P: n/a

ms******@bluewin.ch wrote:
I am fairly new to PHP. I started creating a variety of classes
(calendars, input forms, combo boxes, etc. ) but I am running into code
overhead when I integrate these objects (testing for POST, GETS,
Cookies etc.).

I am looking for an interrupt driven approach to handle event
processing (akin to VB's GUI) to simplify interactions. Basically, I
would like to create the objects to be displayed on the pages and then
activate a page event handler to process ithe inputs. Currently I am
using a mix of js, php and session cookies. But I don't like this
hybrid approach.

AFIK, PHP does not natively support event interrupt handling. Is there
somewhere an add-on or a more elegant work-around to handle such
situations?

I read about Ajax, XML and related technologies. Is this the path to
go? Thanks for any pointers and/or advice.

Mark


The Prado framework might be what you're looking for
http://www.pradosoft.com/. Haven't use it myself--I just saw the
periodic announcements here.

Since you're more comfortable with the event-driven approach, I suspect
you'll be happier programming in ASP.Net.

Jun 20 '06 #3

P: n/a
Also look at AJAX

ms******@bluewin.ch wrote:
I am fairly new to PHP. I started creating a variety of classes
(calendars, input forms, combo boxes, etc. ) but I am running into code
overhead when I integrate these objects (testing for POST, GETS,
Cookies etc.).

I am looking for an interrupt driven approach to handle event
processing (akin to VB's GUI) to simplify interactions. Basically, I
would like to create the objects to be displayed on the pages and then
activate a page event handler to process ithe inputs. Currently I am
using a mix of js, php and session cookies. But I don't like this
hybrid approach.

AFIK, PHP does not natively support event interrupt handling. Is there
somewhere an add-on or a more elegant work-around to handle such
situations?

I read about Ajax, XML and related technologies. Is this the path to
go? Thanks for any pointers and/or advice.

Mark


Jun 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.