Skip to content

Instantly share code, notes, and snippets.

@donnywals
Created February 1, 2013 15:18
Show Gist options
  • Save donnywals/4691911 to your computer and use it in GitHub Desktop.
Save donnywals/4691911 to your computer and use it in GitHub Desktop.
<?php
echo "<h1>stuff in GET</h1>";
var_dump($_GET);
echo "<br /><br />";
echo "<h1>stuff in POST</h1>";
var_dump($_POST);
echo "<br /><br />";
if(isset($_GET['val'])) {
$val = $_GET['val'];
} else {
$val = false;
}
?>
<html>
<head>
<title>Hoi Marijke</title>
</head>
<body>
<h2>Deze knop verstuurt een formulier zonder hidden field</h2>
<form action="index.php" method="post">
<input type="submit" />
</form>
<h2>Deze knop verstuurt een formulier met hidden field</h2>
<form action="index.php" method="post">
<input type="hidden" value="<?= $val ?>" name = "val" />
<input type="submit" />
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment