codigo para contact form flash PHP

Creado a las // 1 commentario
















Contents of the PHP file (mailer.php)

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

Contents of the FLA flash file (ActionScript)

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

1 comentarios:

yasmina dijo...

Son muy largas tus explicaciones y nos duele la mano de tanto escribir el equipo AAAAAAAAAAAAAA