|
Posted by Jerry Stuckle on 06/20/06 01:21
msch-prv@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.
jstucklex@attglobal.net
==================
[Back to original message]
|