Advertisement
Guest User

Untitled

a guest
Dec 5th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.38 KB | None | 0 0
  1. <?php
  2. require "test.html";
  3. session_start();
  4. $validTags = ["!DOCTYPE", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b",
  5.     "base", "basefont", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col",
  6.     "colgroup", "command", "datalist", "dd", "del", "details", "dfn", "dir", "div", "dl", "dt", "em", "embed", "fieldset",
  7.     "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "41", "h5", "h6", "head", "header",
  8.     "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link",
  9.     "map", "mark", "menu", "meta", "meter", "nav", "noframes", "noscript", "object", "ol", "optgroup", "option", "output",
  10.     "p", "param", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source",
  11.     "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th",
  12.     "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"];
  13.  
  14. $_SESSION['count'] = 0;
  15.  
  16. if(isset($_GET['tag'])) {
  17.     if(in_array($_GET["tag"], $validTags)){
  18.         $_SESSION['count']++;
  19.         echo "Valid HTML Tag!<br>Score:"  . $_SESSION['count'];
  20.     } else{
  21.         echo "Invalid HTML Tag!<br>Score: ".$_SESSION['count'];
  22.     }
  23. }
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement