You are here: Re: ActionListener for PHP??? « PHP Programming Language « IT news, forums, messages
Re: ActionListener for PHP???

Posted by Jerry Stuckle on 05/16/07 16:16

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 <form> element.

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.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация