I im trying to redirect to my homepage after submitting a message on my contact form, the form sends the email but I get this message:
Array
(
    [name] =&g         
        
You get this warning because you output to the screen your variables' values and redirecting with header after that.
Headers cannot be sent after your print something (echo , print_r ...).
In order to fix it , follow the next code:
$name = $_POST['name']; //no echo 
$company = $_POST['company'];//no echo 
$email =  $_POST['email'];//no echo 
$content = $_POST['content'];//no echo 
$mail_to = 'info@webelite.se';
$subject = 'Lilla form'.$name;
$body_message = 'From: '. $name . "\n"; 
$body_message .= 'company: '. $company . "\n";
$body_message .= 'E-mail: '. $email ."\n";
$body_message .= 'Message: '. $content;
$headers = 'From: '. $mail_name . "\r\n";
$headers .= 'Reply-To: '. $email ."\r\n";
$success = mail($mail_to, $subject, $body_message, $headers);
//echo "";
//print_r($_POST);