Saturday, 15 May 2010

php - Posting form data to the same page -


I want to post the form-data on the same page where the form is, but the URL looks like this Domain.com/index.php?id=foo , $ _SERVER ['PHP_SELF'] index.php returns when I set the form asset equivalent to domain / index.fpp.id = fo I do not watch this, any suggestions?

Just leave your action = "" attribute in your form Empty

Now, actually submit your form, a & lt; Input type = "submit" name = "your buttons" & gt;

And in your PHP script, just check whether the button has been presented with a simple release function, like

  if (isset ($ _ POST ['yourbutton'])) {// all in one page}  

No comments:

Post a Comment