Skip to content

Instantly share code, notes, and snippets.

@flashadvocate
Last active October 14, 2016 00:25
Show Gist options
  • Save flashadvocate/8d4b3798e07b9bdd1985ff70deb3f6de to your computer and use it in GitHub Desktop.
Save flashadvocate/8d4b3798e07b9bdd1985ff70deb3f6de to your computer and use it in GitHub Desktop.
Self submitting form
<?php
if ($_GET) {
// do something with url params
var_dump($_GET);
} else if ($_POST) {
// do something with posted values
var_dump($_POST);
}
?>
<form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
<input name="someValue" type="text" />
<input name="someOtherValue" type="text" />
<button type="submit">Submit</button>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment