Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <form method="post" autocomplete="off">
  2. <textarea id="wiyetxt" name="input"></textarea>
  3. <input type="submit" value="Send">
  4. <input type="reset" value="Clear">
  5. </form>
  6.  
  7. $input = $_POST["input"];
  8. $keywords = ["apple" => "Found 'apple'", "banana" => "Found 'banana'",
  9. "carrot" => "Found 'carrot'"];
  10. if ($input contains one of these keys) {
  11. alert(value which corresponds to the key);
  12. }
  13. else {
  14. alert("No keys were found")
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement