Jump to content

What am I doing wrong?


Landslyde

Recommended Posts

I have a form set up. One part of that form is a couple radio buttons. The form code for them is:

<label for="who" class="label">Email to:</label>
<input type="radio" name="who" value="Sales" checked>Sales
<input type="radio" name="who" value="Support">Support

In my PHP code, I have this to check which one they selected:

if($who=="Sales") {
    $to = "[email protected]";
    $subject = "Contact Email";
    $headers = "From:" . $email;
    mail($to,$subject,$msg,$headers);
    header("Location: mailreceived.html");
} else {
    $to = "[email protected]";
    $subject = "Contact Email";
    $headers = "From:" . $email;
    mail($to,$subject,$msg,$headers);
    header("Location: mailreceived.html");
}

But even when I select the Sales radio button, the email is sent to Support. What am I not doing right in my If statement?

Link to comment
https://forums.phpfreaks.com/topic/294469-what-am-i-doing-wrong/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.