/ Published in: PHP
                    
                                        
This is useful for escaping multiple values in a POST array.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
foreach($_POST['your_array_here'] as &$val) {
}
// FORM FIELDS EXAMPLE
<input type="text" name="field[p_name]" id="field[p_name]" />
<input type="text" name="field[p_email]" id="field[p_email]" />
// PHP PROCESSING EXAMPLE
function process_form() {
foreach($_POST['field'] as &$val) {
}
$sql = "INSERT INTO my_table (name, email) VALUES ('$p_name', '$p_email')";
}
Comments
 Subscribe to comments
                    Subscribe to comments
                
                