I have a form that uses PHP and MySQL. I would like for a particular button to open a window prompt (much like the Javascript window.prompt function) that allows for a user to enter their name, then carry that name as a variable elsewhere in the PHP script.

For example, clicking button to delete a record opens a prompt/alert/confirm window that asks for the user's name, then the name entered can be stored, emailed, etc.

Anyone have a good way to do this? I've hunted around the net and can't find anything definite.

--
M

    1. use javascript to open a new window
    2. display an HTML form in the new window
    3. when the form is submitted store the data in a [man]session[/man] for future use
      devinemke wrote:

      1. use javascript to open a new window
      2. display an HTML form in the new window
      3. when the form is submitted store the data in a [man]session[/man] for future use

      But how do I call the javascript from within the PHP code?

      --
      M

        mrhinman wrote:

        But how do I call the javascript from within the PHP code?

        javascript is client-side. PHP is server-side. you don't "call the javascript from within the PHP code" as such. PHP can be used to dynamically generate any type of client-side code you want (HTML/JS/CSS/etc...). use the javascript window.open method to open the new window and display your form.

          4 years later

          can u show an example for it as
          i intend to store the value i keyed in in window.prompt box into database using php..
          can show me how ??

            Write a Reply...