Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.91 KB | None | 0 0
  1.  function gVerifSQL($query)
  2. {
  3. $findme   = 'DROP';
  4. $mystring = strtoupper($query);
  5. $pos = strpos($mystring, $findme);
  6. if ($pos === false)
  7.     {
  8.     $findme   = 'CREATE';
  9.     $mystring = strtoupper($query);
  10.     $pos = strpos($mystring, $findme);
  11.     if ($pos === false)
  12.         {
  13.         $findme   = 'ALTER';
  14.         $mystring = strtoupper($query);
  15.         $pos = strpos($mystring, $findme);
  16.         if ($pos === false)
  17.             {
  18.             $findme   = 'INSERT';
  19.             $mystring = strtoupper($query);
  20.             $pos = strpos($mystring, $findme);
  21.             if ($pos === false)
  22.                 {
  23.                 $findme   = 'UPDATE';
  24.                 $mystring = strtoupper($query);
  25.                 $pos = strpos($mystring, $findme);
  26.                 if ($pos === false)
  27.                     {
  28.                     $findme   = 'DELETE';
  29.                     $mystring = strtoupper($query);
  30.                     $pos = strpos($mystring, $findme);
  31.                     if ($pos === false)
  32.                         {
  33.                         echo "<b><br><br>     Commande inconnue..<br></b>";
  34.                         }
  35.                     else
  36.                         {
  37.                         echo "<b><br><br>     Suppression effectuée..<br></b>";
  38.                         }
  39.                     }
  40.                 else
  41.                     {
  42.                     echo "<b><br><br>     Modification effectuée..<br></b>";
  43.                     }
  44.                 }
  45.             else
  46.                 {
  47.                 echo "<b><br><br>     Insertion effectuée..<br></b>";
  48.                 }
  49.             }
  50.         else
  51.             {
  52.             echo "<b><br><br>     Modification effectuée..<br></b>";
  53.             }
  54.         }
  55.     else
  56.         {
  57.         echo "<b><br><br>     Table créée..<br></b>";
  58.         }
  59.     }
  60. else
  61.     {
  62.     echo "<b><br><br>     Table supprimée..<br></b>";
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement