Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example POST request
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Electronic form</title>
</head>
<body>
<form method="POST" id="webform" name="webform" action="target.php">
<label for="iduser">User ID:</label>
<input type="text" id="iduser" name="iduser"> <br />
<label for="idplaylist">Playlist ID:</label>
<input type="text" id="idplaylist" name="idplaylist"> <br />
<label for="v">Video ID:</label>
<input type="text" id="v" name="v"> <br />
<button type="submit">Send data</button>
</form>
</body>
</html>
<?php
// Prints the values of each field on the page
echo(
"The user identified as " . htmlspecialchars($_POST["iduser"], ENT_QUOTES, "UTF-8") . " added the video whose ID is " . htmlspecialchars($_POST["v"], ENT_QUOTES, "UTF-8") . " to the playlist " . htmlspecialchars($_POST["idplaylist"], ENT_QUOTES, "UTF-8") . "."
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment