Posted By

flatearthcomms on 11/15/11


Tagged

regex php regexp


Versions (?)

Loop through $_REQUEST matching a parameter starting xxxxxx.....


 / Published in: PHP
 

  1. foreach ($_REQUEST as $key => $value) {
  2. $value = mysql_real_escape_string( $value );
  3. $value = addslashes($value);
  4. $value = strip_tags($value);
  5.  
  6. if($value != ""){$requestnumber ++;}
  7.  
  8. //echo $key. ' - '.$value.'</br>';
  9.  
  10. if (preg_match('/^item_number/', $key)) {
  11.  
  12. //echo "I have a course key " . $value.'</br>';
  13.  
  14. $sql=" UPDATE `xxx` SET `xxx`='1'WHERE `xxx` = '$value' ";
  15. $result=doSQL($sql);
  16.  
  17. }
  18.  
  19. }

Report this snippet  

You need to login to post a comment.