The way the scripts handles the posted data is confusing but this is how it does it originall before editing:
Code: Select all
public function saveFormData($cf7) {
global $wpdb;
$time = $_SERVER['REQUEST_TIME'] ? $_SERVER['REQUEST_TIME'] : time();
$ip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
$tableName = $this->prefixTableName('SUBMITS');
$parametrizedQuery = "INSERT INTO `$tableName` (`submit_time`, `form_name`, `field_name`, `field_value`) VALUES (%s, %s, %s, %s)";
$title = $this->stripSlashes($cf7->title);
foreach ($cf7->posted_data as $name => $value) {
$value = is_array($value) ? implode($value, ", ") : $value;
$wpdb->query($wpdb->prepare($parametrizedQuery,
$time,
$title,
$this->stripSlashes($name),
$this->stripSlashes($value)));
}
Code: Select all
foreach ($cf7->posted_data as $name => $value) {
extract($value);
}
$parametrizedQuery = mysql_query("INSERT INTO `$tableName` (`submit_time`, `form_name`, `field_name`, `field_value`) VALUES ('$time', '$yourname', '$youremail', '$yourmessage')");
Please help