Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--Write a PHP script PrintTags.php which generates an HTML input text field and a submit button.
- In the text field the user must enter different tags, separated by a comma and a space (", ").
- When the information is submitted, the script should split the tags, put them in an array and
- print out the array. Semantic HTML is required. Styling is not required.-->
- <!DOCTYPE html>
- <html>
- <head lang="en">
- <meta content="text/html" charset="UTF-8">
- <title>Print Tags</title>
- </head>
- <body>
- <form action="#" method="get">
- <p><label for="tags">Enter Tags:</label></p>
- <input type="text" name="tags" id="tags" required/>
- <input type="submit" value="Submit"/>
- </form>
- <?php
- if ($_GET && $_GET['tags']) {
- $tags = explode(', ', trim($_GET['tags']));
- foreach ($tags as $key => $tag) {
- echo "<p>$key : " . htmlspecialchars($tag) . "</p>\n";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement