alohatofu Posted March 27, 2008 Share Posted March 27, 2008 <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 Quote Link to comment https://forums.phpfreaks.com/topic/98219-php-within-a-form-mailer/ Share on other sites More sharing options...
Psycho Posted March 27, 2008 Share Posted March 27, 2008 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'; } Quote Link to comment https://forums.phpfreaks.com/topic/98219-php-within-a-form-mailer/#findComment-502581 Share on other sites More sharing options...
alohatofu Posted March 27, 2008 Author Share Posted March 27, 2008 this is in the intranet so I'm not worry about that. if I want to use it in the first example, how wold I go about in doing it? Thank!@ Quote Link to comment https://forums.phpfreaks.com/topic/98219-php-within-a-form-mailer/#findComment-502585 Share on other sites More sharing options...
Psycho Posted March 27, 2008 Share Posted March 27, 2008 Fine. Go ahead and use bad practices. Use this on your processing page. $send_to = trim($_POST['mailto']); if ($_GET['out']=='Int') { $send_to .= ';me@work.com'; } Quote Link to comment https://forums.phpfreaks.com/topic/98219-php-within-a-form-mailer/#findComment-502660 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.