Jump to content

Recommended Posts

<form method="POST" action="http://emailer.someplace.com/submitform" name="mail_form">
<input type="hidden" name="mailto" value="someone@work.com">
<input type="hidden" name="order" value="out,users,message">
<input type="hidden" name="doublespace" value="no">
<input type="hidden" name="emailfrom" size="30" value="<?php echo $pagesender; ?>">
<input type="hidden" name="mailcc" value="<?php echo $emailfrom; ?>;<?php echo $pagesender; ?>">
<!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<select size="1" name="out">
<option value="Int">Initial</option>
<option value="2hr">2 Hours</option>
<option value="4hr">4 Hours</option>
<option value="6hr">6 Hours</option>
<option value="8hr">8 Hours</option>
<option value="12hr">12 Hours</option>
<option value="16hr">16 Hours</option>
<option value="20hr">20 Hours</option>
<option value="24+hr">24+ Hours</option>
</select>

<input type="submit" value="Send" onclick="javascript:document.forms[0].mailcc.value=document.forms[0].emailfrom.value">
<input type="reset" value="Clear">
<input type="hidden" name="redirecturl" value="http://sendconfirm.php">
</form>



 

What I would like to do is if the user select the value "Int" under the option in the form, the form will be mailed to someone@work.com and me@work.com

 

could someone help me out on that?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/98219-php-within-a-form-mailer/
Share on other sites

Well, first off I would NOT include this line:

<input type="hidden" name="mailto" value="someone@work.com">

 

You should never include an email address on a web page unless you want to receive a ton of spam. Instead handle the mailto address in the processing page.

 

In the processing page I would use something like this:

$send_to = 'someone@work.com';
if ($_GET['out']=='Int') {
    $send_to .= ';me@work.com';
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.