Jump to content

PHP within a form mailer


alohatofu

Recommended Posts

<form method="POST" action="http://emailer.someplace.com/submitform" name="mail_form">
<input type="hidden" name="mailto" value="[email protected]">
<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 [email protected] and [email protected]

 

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="[email protected]">

 

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 = '[email protected]';
if ($_GET['out']=='Int') {
    $send_to .= ';[email protected]';
}

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.