Guest User

Untitled

a guest
Jun 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.17 KB | None | 0 0
  1. <?php
  2. /* Here I must change the inclusion of htmlspecialchars just after checking
  3.  * targey is not null.
  4.  */
  5. //Includes
  6. include('config/config.php');
  7.  
  8. //Retrieving target
  9. @$target = $_POST['target'];
  10. var_dump($target);
  11.  
  12. //Validating target
  13. if(isset($target))
  14. {
  15.     //must check empty() against htmlspecialchars
  16.     if(empty($target))
  17.     {
  18.         $checkTarget = EMPTYTARGET;
  19.         include('includes/indexController.php');
  20.     }
  21.     else
  22.     {
  23.         $target = htmlspecialchars($_POST['target']);
  24.         if(strlen($target)<3 || strlen($target)>50)
  25.         {
  26.             $checkTarget= BADTARGET;
  27.             include('includes/indexController.php');    
  28.         }
  29.         else
  30.         {
  31.             if(is_numeric($target) == true)
  32.             {
  33.                 $targetNumeric = true;
  34.                 var_dump($targetNumeric);
  35.                 include('includes/searchController.php');
  36.             }
  37.             else
  38.             {
  39.                 $targetNumeric = false;
  40.                 var_dump($targetNumeric);
  41.                 include('includes/searchController.php');
  42.             }
  43.         }
  44.     }
  45. }    
  46. else
  47. {
  48.     header('location:index.php');
  49. }
  50. ?>
Add Comment
Please, Sign In to add comment