I have many pages which has the same form so I made a page called contactsGo.php and all the forms on the other pages should send to this page what I need is to redirect from contactsGo.php to each page sent the form
this is my code
<?php
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_post['phone'];
$company=$_POST['company'];
$message=$_POST['message'];
if(isset($_GET['host'])){$host=$_GET['host'];}
if(isset($_GET['uri'])){$uri=$_GET['uri'];}
$recipient='info@siliconerubber-rtv2.com';
$subject="Contact us";
$content = "New Message Form Contact us\n From: ".$name.",\n Email: ".$email.",\n Phone: ".$phone.",\n Company: ".$company.",\n Message: ".$message;
$headers = 'From: info@siliconerubber-rtv2.com'."\r\n" .
'Reply-To: info@siliconerubber-rtv2.com'."\r\n".
'X-Mailer: PHP/' . phpversion();
$retval=mail($recipient, $subject, $content, $headers);
if( $retval == true ){header('Location:'.$host.$uri.'?msg=Message Has been sent successfully');}
else{header('Location:'.$host.$uri.'?msg=Error sending message please try again later');}
?>
and this is the form code
<form id="form1" name="form1" method="get" action="contactsGo.php?<?php echo $_SERVER['HTTP_HOST']; echo rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); ?>">