Created
May 18, 2021 17:24
-
-
Save DaniloCeesar/b49ec6a77f3d75380fe0b689afbfe065 to your computer and use it in GitHub Desktop.
Example POST request
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
<!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> |
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 | |
// 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