-1

I have a form, on its action i have a php file, i want that when i click submit, it should first open the action php (means view in browser), and then start executing the code in it.

form tag is like this

<form action="myScript.php" method="post"></form>

right now what happen is, when i click submit, it stays on the same page and start executing the php file, when it is done then, then it shows the script file page in browser.

Pal Singh
  • 1,964
  • 1
  • 14
  • 29

3 Answers3

0

you can use jquery POST and do what ever you want: jQuery.POST

Rafael Mor
  • 626
  • 1
  • 7
  • 21
0

Is the <input type="submit"> tags etc. inside the <form> tags. If not, then the input buttons are pointless, and just return false. Your code should look like this:

<form action="myScript.php" method="post">
    <input type="submit" />
</form>

Does this help?

Kai :-)

Kai
  • 537
  • 2
  • 6
  • 13
0

You have to execute the PHP in order to generate the page that is shown in the browser as a result of the POST. Even if your PHP is generating the page and then performing a long operation, output buffering and compression will defeat you, so you will need to turn them off. See How to flush output after each `echo` call? for other things you may have to do to get your output to appear immediately.

Community
  • 1
  • 1
Neil
  • 54,642
  • 8
  • 60
  • 72