How to pass a variable from php to a modal?

How do you pass on information from a simple form to a php page.?

  • Please type in the whole code: For example a form that only asks for the first name and once you enter that first name by clicking on submit you delete that first name from your database table of names. So there should be a .html page and a .php page that work together. I am very confused how to grab the info and use it to run the php code. Please know that I am not looking for typing a first name and get Hello "First name". This is not what I am looking for. Thanks,

  • Answer:

    You do the lot in one Php script! index.php: <?php if ( $_POST [ ' name ' ] != " " ) // if this is set, you are RETURNING to the page after filling and submitting the form. The variable IS in $_POST { $name = $_POST [ ' name ' ]; // your code here to delete $name } else // First time in index: $_POST is not set, so you show the form! { echo ( " <form name='xyz' action = index.php method = POST >"); echo ( " <input name='name' ... >"); echo ( " <input type='submit' ... >"); echo ( " </form>"); } ?> But you should have tried first that "Hello firstname": it is the same principle.

farzd at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.