Jump to content

form processing help


Stephen68

Recommended Posts

Ok I loop through the form fields and put them into an array which I implode into a string. What I am wondering if

mysql_real_escape_string() on the string will work.

 

<?php
$exclude = array("month", "day", "year", "submit2","submit33");

foreach ($_POST as $field=>$value) {//Start foreach loop
    //If the $field is month,day,year,submit2 or submit33 then skip them
	if(!in_array($field, $exclude)) {
	    $names[] = "$field="."'".$value."'";
	}
}// end of foreach loop

$updateString = implode(",",$names);

$updateString = mysql_real_escape_string($updateString);
?>

 

will the mydql_real_escape_string() work like this for mysql insert?

Thanks for the help

 

Steve

Link to comment
https://forums.phpfreaks.com/topic/144718-form-processing-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.