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

ActionListener for PHP???

P: n/a
Quite a while back I used Java Swing (for Uni project) which allowed the
developer to a create form and on the "Submit" button I recall adding
something called an ActionListener. I was thinking of trying to do the
something similar in PHP but a bit puzzled on how I would achieve it.

My thoughts are to have a class for a Textbox, class for a SubmitButton and
a class called ActionListener which is invoked (is that the correct term??)
when the SubmitButton is pressed. Each instance of the ActionListener class
will have a seperate set of instructions.

Does anyone know of any tutorials online that discuss something like above?
I've looked at a couple of Frameworks and QCodo does something along these
lines.

Cheers

Phil
May 15 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Phil Latio wrote:
Quite a while back I used Java Swing (for Uni project) which allowed the
developer to a create form and on the "Submit" button I recall adding
something called an ActionListener. I was thinking of trying to do the
something similar in PHP but a bit puzzled on how I would achieve it.

My thoughts are to have a class for a Textbox, class for a SubmitButton and
a class called ActionListener which is invoked (is that the correct term??)
when the SubmitButton is pressed. Each instance of the ActionListener class
will have a seperate set of instructions.

Does anyone know of any tutorials online that discuss something like above?
I've looked at a couple of Frameworks and QCodo does something along these
lines.

Cheers

Phil

Phil,

You don't do it the same way in PHP. Java is much more event-driven
than PHP; it's doing some things behind the scenes that PHP doesn't do
for you.

When the submit button is pressed, a form is submitted to the server.
This includes a request for the page identified in the action= parameter
of your <formelement.

Java will take this request and drive the appropriate listeners for you.
PHP won't. In PHP you get the input via either $_GET or $_POST
(depending on the method= parameter) and handle the request.

It's a little more work for you to do it - but less overhead on the
server (Java calls action listeners for every bean being used, whether
you've overridden it or not).

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

This discussion thread is closed

Replies have been disabled for this discussion.