I need to insert banner data into a table wp_rdp_banners. To work with the banner data I insert the full affiliate link and also split it to save the banner url and banner image location into separated fields.
Somehow there is no data inserted. Also get no error reports in debug.log file. When I print_r($POST) all seems okay. Correct amount of fields + data. But nothing is insert at all.
Does someone of you have an idea what I do wrong or forget in the code below?
<a href="https://mobico.nl/telefoon/?tt=26156_1144596_250041_&r=" target="_blank" rel="nofollow"><img src="http://ti.tradetracker.net/?c=26156&m=1144596&a=250041&r=&t=html" width="300" height="250" border="0" alt="" /></a>
if(isset($_POST['add_new_banner'])){
global $wpdb;
extract($_POST);
$fulllink = htmlspecialchars($aff_link);
$fulllink = stripslashes($fulllink) ;
preg_match_all('!https?://\S+!', $fulllink, $matches);
$affUrl =$matches[0][0]; // URL link of the banner
$imgLink =$matches[0][1]; // img link from the banner st
$company_name = get_user_meta($customer_id,'company_name',true);
$wpdb->insert(
$wpdb->prefix.'rdp_banners',
array(
'banner_type' => $banner_type,
'customer_id' => $customer_id,
'company_name' => $company_name,
'start_date' => $start_date,
'end_date' => $end_date,
'price' => $price,
'aff_link' => htmlspecialchars($aff_link),
'aff_customer' => $aff_customer,
'aff_url' => $affUrl,
'aff_target' => $aff_target,
'aff_rel' => $aff_rel,
'aff_img' => $imgLink,
'aff_img_width' => $aff_img_width,
'aff_img_height'=> $aff_img_height,
'aff_img_alt' => $aff_img_alt,
'banner_link' => $banner_link,
'picture' => $picture
),
array( '%d', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')
);
}
exit( var_dump( $wpdb->prepare ) );
result = NULL
wp_rdp_banners
"extract($_POST);
is extremely dangerous, anybody can overwrite anything in the global namespace here, this is a super critical vulnerability. Don't useextract