"."\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $emailbody = "
You have recieved a new support from Instagram Feed Plugin.
Name: {$name}
Email Address: {$email}
Telephone: {$telephone}
Enquiry: {$enquiry}
Message: {$message}
This message was sent from the IP Address: {$ipaddress} on {$date} at {$time}
"; mail("arrowplugins@gmail.com","Instagram Feed Plugin Support",$emailbody,$headers); } //what we need to return back to our form $returndata = array( 'posted_form_data' => array( 'name' => $name, 'email' => $email, 'telephone' => $telephone, 'enquiry' => $enquiry, 'message' => $message ), 'form_ok' => $formok, 'errors' => $errors ); //if this is not an ajax request if(empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest'){ //set session variables session_start(); $_SESSION['cf_returndata'] = $returndata; //redirect back to form header('location: ' . $_SERVER['HTTP_REFERER']); } }