You are here: Re: Help with PHP & Form Popup « PHP Language « IT news, forums, messages
Re: Help with PHP & Form Popup

Posted by shimmyshack on 02/26/07 19:00

On 26 Feb, 16:57, "ame...@iwc.net" <ame...@iwc.net> wrote:
> Hi Everyone,
>
> I am very new to this, so I'm hoping someone can help.
>
> I have a form with buttons that a user can click. What I need to do
> is that when a user clicks a button, before the form submits, I need
> to show a popup window with a drop down list of values which were
> returned from a MySQL query. And, the value selected will help drive
> the next page shown to the user.
>
> I've created the simple PHP to query the MySQL database, and, it
> properly returns the values which I store in an array. However, I
> have no clue on how to do a Javascript popup, let alone passing the
> results from the MySQL query to be drawn on that popup html
> page........
>
> Can anyone help by either showing me some code or point me to a page
> that has what I'm looking for? I've been at this for a few hours
> already.
>
> Thanks in advance!

You can do this without pop ups [javascript or not], which are not
accessible and are actually annoying, (some people dont allow them
while others have them open in a new tab etc...) you shouldnt use them
to drive your application, learn from google or other large sites
which often have to process large amounts of dependent info and do so
with no pop ups whatsoever.
Instead have two scripts, you initial form which the user fills in,
and a second perhaps called 2nd_step.php which has a form inside with
a hidden field, or multiple hidden fields, as well as the mysql query
driven fields, then when the user selects the mysql driven values, s/
he submits the form which submits the whole lot to whereever your
handling logic is, perhaps 3rd_stage.php

So 2nd_step would take the form values from 1st_step.php and serialise
them and then a string is produced which can be stored inside the
hidden field in 2nd_step.php, or if you dont serialise them you can
just populate identical fields. If you are worried about the first
form not being filled properly and having to send back the errors to
the user, then just use a session to store the submitted values, and
then redirect to the 1st_step script which should use the session
values to populate the values, remember to escape all html before
echoing them in the value="" inside the fields.

This way you have a seemless way to pass data between pages, without
needing pop ups or even js scripting available.

 

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

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