Last active
October 14, 2016 00:25
-
-
Save flashadvocate/8d4b3798e07b9bdd1985ff70deb3f6de to your computer and use it in GitHub Desktop.
Self submitting form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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