<?php require_once('../../../../../wp-config.php'); require_once('../../opt.php'); require_once('../../includes/dwpc_start.php'); require_once('../../includes/opt_apptop.php'); if(isset($_GET['dwpc_impression_id']) && isset($_GET['optinlinks_email']) && isset($_GET['optinlink_id']) && isset($_GET['optinlinks_form_html'])) { $dwpc->dwpc_visitor(); $impression_id = mysql_real_escape_string($_GET['dwpc_impression_id']); $optinlink_id = mysql_real_escape_string($_GET['optinlink_id']); $form_id = mysql_real_escape_string($_GET['form_id']); $email = rawurldecode($_GET['optinlinks_email']); $name = rawurldecode($_GET['optinlinks_name']); $impression = $wpdb->get_row('SELECT * FROM '.OPT_DB_PREFIX.'dwpc_impressions WHERE text_id="'.$impression_id.'" AND dwpc_visitor_id = '.$dwpc->visitor['id']); if($impression!='') { $optinlink = $wpdb->get_row('SELECT * FROM '.OPT_DB_PREFIX.'opt_optin_links WHERE id="'.$optinlink_id.'"'); $in_sql = ''; if(!array_key_exists('form_id',$_GET)){ $in_sql = 'opt_mailer_id IN (SELECT id FROM '.OPT_DB_PREFIX.'opt_mailers WHERE mailer_type="Custom")'; }else{ $in_sql = 'opt_mailer_id = '.$form_id; } $form_check = $wpdb->get_results('SELECT * FROM '.OPT_DB_PREFIX.'opt_mailers_to_campaigns WHERE opt_campaign_id = '.$optinlink->opt_campaign_id.' AND '.$in_sql,ARRAY_A); if($form_check!='') { $form = $wpdb->get_row('SELECT * FROM '.OPT_DB_PREFIX.'opt_mailers WHERE id = '.$form_check[0]['opt_mailer_id']); if($form!='') { ?> <!doctype html> <html> <head> <meta charset="utf-8"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> </head> <body> <script type="text/javascript"> jQuery( document ).ready(function() { <?php if($name!='') { ?> jQuery( "input[name*='nam']:text" ).val("<?php echo $name; ?>"); <?php } ?> jQuery( "input[name*='mai']:text" ).val("<?php echo $email; ?>"); jQuery( "input[name*='mai'][type=email]" ).val("<?php echo $email; ?>"); jQuery( "#opt_custom_form<?php echo $form->id;?>" ).submit(); /*i dont get why it works this way....wat*/ document.getElementById('opt_custom_form<?php echo $form->id;?>').submit.click(); }); </script> <?php $form_html = str_ireplace('onsubmit','dontdothis',$form->custom_form_html); $form_html = str_ireplace('<script','<ineffective',$form_html); $form_html = str_ireplace('</script>','</ineffective>',$form_html); $form_html = str_ireplace('id=','null=',$form_html); $form_html = str_ireplace('<form','<form id="opt_custom_form'.$form->id.'" ',$form_html); $form_html = str_ireplace('</form>','<input type="submit"></form>',$form_html); echo stripslashes($form_html); ?> <?php if(!array_key_exists('form_id',$_GET)){ unset($form_check[0]); $url = plugins_url('/opt/admin_pages/ajax/form_submit.php').'?optinlinks_email='.rawurlencode($email).'&optinlinks_name='.rawurlencode($name).'&dwpc_impression_id='.$impression_id.'&optinlink_id='.$optinlink_id.'&optinlink_form_html=1'; foreach($form_check as $value){ ?> <iframe src="<?php echo $url.'&form_id='.$value['opt_form_id'];?>"></iframe> <?php } } ?> </body></html> <?php } } } } ?>