Re: AJAX and PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Alain Roger <raf.news@xxxxxxxxx>:

Hi,

i'm playing around with AJAX and PHP to create something like a "small
desktop" application.
basically the first step is to log in the system.
for that i have a log-in form where users can choose the interface language.

here is my problem :
when the log-in form runs, it is in English. user can click on some arrow to
open another DIV and display all other languages available.
a click on a particular flag, will call the PHP page where the log-in form
(login field + password field) are stored with dynamic language interface.

however, i make no sense for the title of this form to call a PHP page where
will be just 1 dynamic text (changing on flag choice).
so if you understand well, i have 2 divs (1 for form title, 1 for log-in
form itself). and i load thanks AJAX php code into divs.

my problem is that i do not want to write a PHP page just for 1 label... it
makes sense for a complete form but not for a simple text line or label.

So how can i do that without refreshing page. using AJAX and PHP only ?
i guess you already faced such situation so i would really appreciate your
help.

thanks a lot,

--
Alain

Making an Ajax request for one little label maybe a bit overkill.
As i understand you request the whole form through an Ajax request. And display this to the user? And every language generates a new form?

Why not just create the form dynamically with javascript and load the data from PHP. So the form can stay the same for all calls. You just fill it with data depending on the language selected. You can fill the form for instance by sending a JSON encoded object from PHP to javascript.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux