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


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.