mail to email address chosen by user via simplemodal form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dpcdesigns
Forum Newbie
Posts: 1
Joined: Wed Oct 21, 2009 1:20 pm

mail to email address chosen by user via simplemodal form

Post by dpcdesigns »

Hi,
I'd post this in a more relevent forum but, the only one for this script is for wordpress which i'm not using.

I'm trying to modify the SimpleModal Contact Form (http://www.ericmmartin.com/projects/smcf/) so that i can have it email to 1 of 2 email addresses chosen by the user from a drop down. i added this following into the code

Code: Select all

// User settings
$to = $nse;
$subject = "SimpleModal Contact Form";
$nse = "".$_POST["nse"];
and in the form i added

Code: Select all

<label for='sendto'>To:</label>
            <select class='nse' tabindex='1000' name='nse' id='nse'><option id='nse' name='email1@nse.com' value='email1@nse.com'>email1@nse.com</option><option id='nse' name='email2@nse.com' value='email2@nse.com'>email2@nse.com</option></select>
when it comes to this part

Code: Select all

    if ($token === smcf_token($to)) {
        smcf_send($name, $email, $subject, $message, $cc);
        echo "Your message was successfully sent.";
    }
    else {
        echo "Unfortunately, your message could not be verified.";
    }
}
i get "Unfortunately, your message could not be verified."

I'm not the best at php and i can't figure out why this isn't working. if anyone can shed some light on this i'd greatly appreciate it. i"m attaching the full code for you to view as well

Thanks.
Derek
contact_review.zip
(2.58 KiB) Downloaded 2 times
Post Reply