PHP: Emailing echo results -
i'm on homestretch of project have been working on 2 weeks. html form created , fully, , functionally, compatible php. currently, after submitting form echo's results back. @ point, don't know go next.
i able take information page, , add numerical digital signature (much pin) , submit final results email using php.
i can 2 separately. ie - can create form echo results, , can create form e-mails results, don't understand how them in conjunction each other.
how can submit form's echo results e-mail, while adding digital signature?
(since offer no code, i'm new php, don't expect -do- me, i'm struggling find relevant information via google searches, pointing me in right direction incredibly helpful.)
thanks
and know better. code:
html
<form action="echo_form_email.php" method="get"> <p> <div id="cheddar">cashier: <input id="cashier" name="cashier" type="text"></div> </p> <p> <div id="q">did cashier front register?</div> <div id="radio1"><input type="checkbox" name="front_register" value="yes">yes</div> <div id="radio2"><input type="checkbox" name="front_register" value="no">no</div> <div id="radio3"><input type="checkbox" name="front_register" value="n/a">n/a</div> </p> <p> <div id="q">genuinely greet customer eye contact?</div> <div id="radio1"><input type="checkbox" name="greets" value="yes">yes</div> <div id="radio2"><input type="checkbox" name="greets" value="no">no</div> </p> <p> <div id="q">scan/unload b.o.b. (if no bagger)</div> <div id="radio1"><input type="checkbox" name="scan_bob" value="yes">yes</div> <div id="radio2"><input type="checkbox" name="scan_bob" value="no">no</div> <div id="radio3"><input type="checkbox" name="scan_bob" value="n/a">n/a</div> </p> <p> <div id="q">carry conversation around product in basket or genuine conversation?</div> <div id="radio1"><input type="checkbox" name="conversation" value="yes">yes</div> <div id="radio2"><input type="checkbox" name="conversation" value="no">no</div> <div id="radio3"><input type="checkbox" name="conversation" value="n/a">n/a</div> </p> <p> <div id="q">offer buddy bucks parent @ beginning of order?</div> <div id="radio1"><input type="checkbox" name="buddy" value="yes">yes</div> <div id="radio2"><input type="checkbox" name="buddy" value="no">no</div> <div id="radio3"><input type="checkbox" name="buddy" value="n/a">n/a</div> </p> <p> <div id="q">avoid side conversations?</div> <div id="radio1"><input type="checkbox" name="side_conversation" value="yes">yes</div> <div id="radio2"><input type="checkbox" name="side_conversation" value="no">no</div> </p> <p> <div id="q">point out , circle savings?</div> <div id="radio1"><input type="checkbox" name="savings" value="yes">yes</div> <div id="radio2"><input type="checkbox" name="savings" value="no">no</div> <div id="radio3"><input type="checkbox" name="savings" value="n/a">n/a</div> </p> <p> <div id="q">offer carryout (if no bagger)?</div> <div id="radio1"><input type="checkbox" name="carry_out" value="yes">yes</div> <div id="radio2"><input type="checkbox" name="carry_out" value="no">no</div> <div id="radio3"><input type="checkbox" name="carry_out" value="n/a">n/a</div> </p> <p> <div id="q">give genuine "thank you"?</div> <div id="radio1"><input type="checkbox" name="thanks" value="yes">yes</div> <div id="radio2"><input type="checkbox" name="thanks" value="no">no</div> </p> <p> <div id="cheddar">digital signature</div> <div id="cheddar"><input type="tel" name="sign1" placeholder="peoplesoft id"></div> </p> <p> <div id="auditingasm">asm performing audit: <br /> <select name="asm"> <option value="john doe">john doe</option> <option value="jane doe">jane doe</option> <option value="little doe">little doe</option> <option value="big doe">big doe</option> </select></div> </p> <br /> <input type="submit" value="submit" name="submit"> <input id="reset" type="reset"> </form>
php form echo
<?php if (! empty($_get['cashier'])){ echo 'cashier receiving audit: ' . $_get['cashier']; } echo "<br />"; if (! empty($_get['asm'])){ echo 'asm performing audit: ' . $_get['asm']; } echo "<br /><br />"; if (! empty($_get['front_register'])){ echo 'did cashier front register? ' . $_get['front_register']; } echo "<br />"; if (! empty($_get['greets'])){ echo 'greet customer eye contact? ' . $_get['greets']; } echo "<br />"; if (! empty($_get['scan_bob'])){ echo 'scan/unload bob (if no bagger) ' . $_get['scan_bob']; } echo "<br />"; if (! empty($_get['conversation'])){ echo 'conversation groceries, or other genuine conversation? ' . $_get['conversation']; } echo "<br />"; if (! empty($_get['buddy'])){ echo 'offer buddy bucks parent @ beginning of order? ' . $_get['buddy']; } echo "<br />"; if (! empty($_get['side_conversation'])){ echo 'no side conversations? ' . $_get['side_conversation']; } echo "<br />"; if (! empty($_get['savings'])){ echo 'cashier pointed , circled savings? ' . $_get['savings']; } echo "<br />"; if (! empty($_get['carry_out'])){ echo 'offered carry out (if no bagger) ' . $_get['carry_out']; } echo "<br />"; if (! empty($_get['thanks'])){ echo 'genuine "thank you?" ' . $_get['thanks']; } echo "<br /><br />"; if (! empty($_get['sign1'])){ echo 'digital signature: ' . $_get['sign1']; } ?>
php form email
original php attached form e-mailed correct address make form printable. code prior 1 php echo, @death saw posted in forum earlier today.<? //--------------- // cashier audit //--------------- $msg .= "cashier being audited: ".$_post["cashier"].""; $msg .= "\n\nfront register? $front_register\n"; $msg .= "greet customer eye contact? $greets\n"; $msg .= "scan/unload bob (if no bagger) $scan_bob\n"; $msg .= "conversation groceries, or other genuine conversation? $conversation\n"; $msg .= "offer buddy bucks parent @ beginning of order? $buddy\n"; $msg .= "no side conversations? $side_conversation\n"; $msg .= "cashier pointed , circled savings? $savings\n"; $msg .= "offered carry out (if no bagger)? $carry_out\n"; $msg .= "genuine thank you? $thanks\n\n"; $msg .= "**************************************************************\n"; $msg .= "\n\n\ncashier signature:__________________________"; $msg .= "\n $cashier"; $msg .= "\n\n\n\n\nasm signature:__________________________"; $msg .= "\n $asm"; //----------------- // signature lines //----------------- .= $checkbox=$_post['checkbox']; .= $asm = $_post['asm']; $to = "email@address.com"; $from = "other@email.com"; $subject = "service audit"; $mailheaders = "from: \"$asm\" <$from> . \n"; //$mailheaders .= "reply-to: $from\n\n"; mail($to, $subject, $msg, $mailheaders); ?>
if understand correctly, have html form , to:
audit staff member on html/php form (
audit.php
)post results of audit php page/form (
audit_confirm.php
)the employee enters id on
audit_confirm.php
, clicks 'submit'the information sent email
audit form [audit.php]
your first page/form posts data confirmation page, change action attribute of form tag post audit_confirm.php
i.e.
<form action="audit_confirm.php" method="post"> <!-- existing form data--> </form>
audit confirmation form [audit_confirm.php]
on audit_confirm.php
create logic that:
- displays results of audit
- provide confirmation form containing text box enables employee enter id
- post information same page , capture post data (a hidden form element can used segment form logic flow)
- send email audit data
- redirect
audit.php
page can perform audit
replace have called php form echo
this:
<?php switch(true) { case ($_post['employee_id_confirm'] == true): //--------------- // cashier audit //--------------- $msg .= "cashier being audited: ".$_post['cashier'].""; $msg .= "\n\nfront register? ".$_post['front_register']."\n"; $msg .= "greet customer eye contact? ".$_post['greets']."\n"; $msg .= "scan/unload bob (if no bagger) ".$_post['scan_bob']."\n"; $msg .= "conversation groceries, or other genuine conversation? ".$_post['conversation']."\n"; $msg .= "offer buddy bucks parent @ beginning of order? ".$_post['buddy']."\n"; $msg .= "no side conversations? ".$_post['side_conversation']."\n"; $msg .= "cashier pointed , circled savings? ".$_post['savings']."\n"; $msg .= "offered carry out (if no bagger)? ".$_post['carry_out']."\n"; $msg .= "genuine thank you? ".$_post['thanks']."\n\n"; $msg .= "**************************************************************\n\n\n\n\n"; $msg .= "cashier signature: ".$signature."\n"; $msg .= " _______________________________"; $msg .= "\n $cashier"; $msg .= "\n\n\n\n\n"; $msg .= "asm signature: ".$asm."\n"; $msg .= " ________________________________"; $msg .= "\n $asm"; $to = "email@address.com"; $from = "other@email.com"; $subject = "service audit"; $mailheaders = "from: \"".$asm."\" <".$from.">\r\n". "reply-to: noreply@yourdomain.com\r\n". "x-mailer: php/". phpversion(); mail($to, $subject, $msg, $mailheaders); //redirect audit.php header("location:audit.php"); exit(); break; } //form data audit.php $get_data_meta_arr = array( 'cashier' => 'cashier receiving audit:', 'asm' => 'asm performing audit:', 'front_register' => 'did cashier front register?', 'greets' => 'greet customer eye contact?', 'scan_bob' => 'scan/unload bob (if no bagger)', 'conversation' => 'conversation groceries, or other genuine conversation?', 'buddy' => 'offer buddy bucks parent @ beginning of order?', 'side_conversation' => 'no side conversations?', 'savings' => 'cashier pointed , circled savings?', 'carry_out' => 'offered carry out (if no bagger)', 'thanks' => 'genuine "thank you?"' ); ?> <html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1"> <title>info confirm</title> </head> <body> <div id="view-info"> <h2>audit confirmation</h2> </div> <div id="form-confirm"> <form action="<?php echo $_server['php_self']; ?>" method="post"> <div class="field-hidden"> <input type="hidden" name="employee_id_confirm" value="true"> </div> <div class="echo"> <?php foreach($get_data_meta_arr $key => $value) { $audit_question_str = $value; //the audit question $audit_result_str = $_get[$key]; //the audit result ?> <p><?php echo $audit_question_str.': '.$audit_result_str; ?></p> <input type="hidden" name="<?php echo $key; ?>" value="<?php echo $audit_result_str; ?>"> <?php } ?> </div> <div class="field"> <label for="employee_id">employee id</label> <input id="employee_id" type="text" name="signature" maxlength="40"> </div> <div class="action"> <input type="submit" value="confirm"> </div> </form> </div> </body> </html>
you can away php form email
email messaging feature built-in above code.
i hope helps.
Comments
Post a Comment