Hello,
I have a problem with a _POST variables which is empty after URL rewriting and redirection.
<form name="myform" id="contactForm" action="http://example.com/sendcontact.php" method="post">
<article class="span6">
<textarea id="msg" rows="3" cols="40" name="message" placeholder="Message">Détails</textarea>
</article>
<article class="span6">
<input type="text" name="adresse" id="adresse">
<input size="100" type="text" name="name" id="name" placeholder="Nom">
<input type="text" size="30" id="email" name="email" placeholder="Adresse e-mail">
<button type="submit" name="submit" id="submit" class="btn btn-renova-alt add-top-half">Send message</button>
</article>
</form>
<?php
if($adresse != "" ){
}
else{
if(isset($_POST['submit']))
{
$to = "daniel@example.com";
$subject = "Email from";
$name_field = stripslashes($_POST['name']);
$email_field = $_POST['email'];
$message = stripslashes($_POST['message']);
$body = "<html>\
";
$body .= "<body style=\\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#666666;\\">\
";
$body .= "From: $name_field <br/> E-Mail: $email_field <br/> Message: <br/> $message";
$body .= "</body>\
";
$body .= "</html>\
";
$headers = 'MIME-Version: 1.0' . "\
";
$headers .= 'Content-type: text/html; charset=utf-8' . "\
";
$headers .= 'Reply-to: '.$name_field. '<'.$email_field.'>' . "\
" ;
$headers .= 'Return-path: '.$name_field. '<'.$email_field.'>' . "\
" ;
$headers .= 'From: MGS < contact@example.com >' . "\\r\
";
$name_field = stripslashes($name_field);
$message = stripslashes($message);
mail($to, $subject, $body, $headers);
unset($name_field);
unset($email_field);
unset($message);
}
else
{
echo "Failure!";
}
}
?>
RewriteEngine on
#RewriteCond %{HTTP_HOST} ^example\\.com$ [OR]
#RewriteCond %{HTTP_HOST} ^www\\.example\\.com$
#RewriteRule ^/?$ "https\\:\\/\\/www\\.example\\.com\\/" [R=301,L]
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
The URL is rewritten correctly but I get an empty value for my POST variable.
PS: I don’t get none past variables by the form
Do you have a solution to this?
thank you