<?php if ('POST' == $_SERVER['REQUEST_METHOD']) { if ($_FILES) { $files = $_FILES["bux_multiple_attachments"]; foreach ($files['name'] as $key => $value) { if ($files['name'][$key]) { $file = array('name' => $files['name'][$key], 'type' => $files['type'][$key], 'tmp_name' => $files['tmp_name'][$key], 'error' => $files['error'][$key], 'size' => $files['size'][$key]); $_FILES = array("bux_multiple_attachments" => $file); foreach ($_FILES as $file => $array) { $newupload = kv_handle_attachment($file, $pid); } } } } }
$arg_insert['taxo'] = array('tax' => 'model-category', 'term' => intval($_POST['tax_models'])); } } } $uploaded_id = upload_custom_post($arg_insert); //var_dump($arg_insert); //var_dump($_FILES['fileselect']); $attach_array = array(); if ($_FILES['fileselect']) { $files = $_FILES['fileselect']; foreach ($files['name'] as $key => $value) { if ($files['name'][$key]) { $file = array('name' => $files['name'][$key], 'type' => $files['type'][$key], 'tmp_name' => $files['tmp_name'][$key], 'error' => $files['error'][$key], 'size' => $files['size'][$key]); $_FILES = array("fileselect" => $file); foreach ($_FILES as $file => $array) { $newupload = kv_handle_attachment($file, $uploaded_id); array_push($attach_array, $newupload); } } } update_field("field_569e36c6a976e", $attach_array, $uploaded_id); } //$mail = new PHPMailer; $mail->SMTPDebug = 3; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.gmail.com '; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication