topical media & game development

talk show tell print

professional-search-08-seophp-comments.php / php



  <?php
  // load the nofollow library
  require_once 'include/nofollow.inc.php';
  // load the sanitize library
  require_once 'include/sanitize.inc.php';
  // load simple CAPTCHA library
  require_once 'include/simple_captcha.inc.php';
  ?>
  
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  <html>
    <head>
      <title>Professional Search Engine Optimization with PHP: Comments</title>
    </head>
    <body>
      <h1>Old comments:</h1>
  
  <?php
  
  // display first comment
  echo noFollowLinks('<p>Hello! Take a look at <a href="http://too.much.spam">cool link</a>!</p>');
  
  // display second comment
  echo noFollowLinks('<p>We\'ve just released our new product, <a href="http://seophp.example.com/Products/SEO-Toolbox-C6/Link-Juice-P31.html">Link Juice</a>.</p>');
  
  // display third comment
  inHTML = '<p>Sanitizing <img src="INVALID-IMAGE"' . 
            'onerror="location.href=\'http://too.much.spam/\'">!</p>';
  echo sanitizeHTML(inHTML);
  
  // display CAPTCHA question
  SimpleCAPTCHA::display_demo_form(); 
  // display answer
  if (isset(_GET['response']) && isset(_GET['hash'])) 
  {
    if(SimpleCAPTCHA::check_answer(_GET['response'], _GET['hash']))
    {
      echo 'Correct!';
    }
    else
    {
      echo 'Wrong answer!';
    }
  }
  
  ?>
  
    </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.