PHP 文件内容 (mailer.php)

  1. <?php
  2. /* ---------------------------
  3. php and flash contact form.
  4. by www.MacromediaHelp.com
  5. ---------------------------
  6. Note: most servers require that one of the emails (sender or receiver)
  7. to be an email hosted by same server, so make sure your email
  8. (on last line of this file) is one hosted on same server.
  9. --------------------------- */
  10.  
  11. // read the variables form the string, (this is not needed with some servers).
  12. $subject = $_REQUEST["subject"];
  13. $message = $_REQUEST["message"];
  14. $sender = $_REQUEST["sender"];
  15.  
  16. // include sender IP in the message.
  17. $full_message = $_SERVER['REMOTE_ADDR'] . "\n\n" . $message;
  18. $message= $full_message;
  19.  
  20. // remove the backslashes that normally appears when entering " or '
  21. $message = stripslashes($message);
  22. $subject = stripslashes($subject);
  23. $sender = stripslashes($sender);
  24.  
  25. // add a prefix in the subject line so that you know the email was sent by online form
  26. $subject = "Contact form test". $subject;
  27.  
  28. // send the email, make sure you replace email@yourserver.com with your email address
  29. if(isset($message) and isset($subject) and isset($sender)){
  30. mail("email@yourserver.com", $subject, $message, "From: $sender");
  31. }?>

flash 文件as内容:

  1.  
  2. stop();
  3.  
  4. send_btn.onRelease = function() {
  5. my_vars = new LoadVars();
  6. my_vars.sender = email_box.text;
  7. my_vars.subject = subject_box.text;
  8. my_vars.message = message_box.text;
  9. if (my_vars.sender != "" and my_vars.subject != "" and my_vars.message != "") {
  10. my_vars.sendAndLoad("mailer.php", my_vars, "POST");
  11. gotoAndStop(2);
  12. } else {
  13. error_clip.gotoAndPlay(2);
  14. }
  15. my_vars.onLoad = function() {
  16. gotoAndStop(3);
  17. };
  18. };
  19. email_box.onSetFocus = subject_box.onSetFocus=message_box.onSetFocus=function () {
  20. if (error_clip._currentframe != 1) {
  21. error_clip.gotoAndPlay(6);
  22. }
  23. };

顶一下
(6)
100%
踩一下
(0)
0%