Skip to content

Instantly share code, notes, and snippets.

@niravmadariya
Last active June 7, 2018 07:01
Show Gist options
  • Save niravmadariya/f71665fa26b22fe0f68a399188f359c3 to your computer and use it in GitHub Desktop.
Save niravmadariya/f71665fa26b22fe0f68a399188f359c3 to your computer and use it in GitHub Desktop.
GET and POST exmaple in PHP
<form action="" method="POST">
<input type="submit" value="submit" name="submit" />
</form>
<form action="">
<input type="submit" value="submit" name="submit"/>
</form>
<?php
if(isset($_POST['submit'])){
echo "Submitted via POST";
}
else if(isset($_GET['submit'])){
echo "Submitted via GET";
}
else {
echo "This is GET POST Example";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment