Un autre PHP / FLASH Dilema FORMULAIRE DE CONTACT vierges envoie des e-mails

  • e.s.guardian
  • Newbie
  • Newbie
  • No Avatar
  • Inscription: Mar 14, 2007
  • Messages: 8
  • Status: Offline

Message Mars 14th, 2007, 10:38 am

J'ai un formulaire de contact dans mon site flash. En bref, il ya deux boutons envoyer et clair, lorsque vous cliquez sur le bouton envoyer, son prétendu pour vous emmener à étiquette de la fenêtre "correct", mais rien ne se passe...Entre temps, ma boîte de réception se remplit avec les emails en blanc. So whats happening? PHP est la forme n'a pas rassemblé de mes variables?

C'est ce que j'ai dans mon formulaire Flash et la forme Php
Code: [ Select ]
this.stop();
// -------------------<send form LoadVars>------------------- \
var gatherForm:LoadVars = new LoadVars();
var receiveForm:LoadVars = new LoadVars();
receiveForm.onLoad = function() {
    if (this.response == "passed") {
        name_txt.text = "";
        email_txt.text = "";
        phone_txt.text = "";
        msg_txt.text = "";
        trace("email sent");
        gotoAndStop("correct");
    }
};
function sendForm() {
    gatherForm.email_to = "eric.shomer@gmail.com";
    gatherForm.visitor_comments = msg_txt.text;
    gatherForm.visitor_name = name_txt.text;
    gatherForm.visitor_email = email_txt.text;
    gatherForm.visitor_phone = phone_txt.text;
    // You may want to try the absolute http to this file i.e. http://www.mydomain.com/form.php 
    // If you are testing on the local system and it doesn't know how to parse php,
    // you'll never get a response back from the file.
    gatherForm.sendAndLoad("http://www.bodyshopfitnesscenter.com/email.php", receiveForm, "POST");
}
// -------------------</send form LoadVars>------------------- \
//--------------------<submit button AS>---------------------\
// onRelease
submitBtn.onRelease = function() {
    if (email_txt.text == "" || phone_txt.text == "" || name_txt.text == "" || msg_txt.text == "") {
        gotoAndStop("error");
    } else {
        sendForm();
    }
};
//--------------------</submit button AS>---------------------\

<?php
/***************************************************\
* PHP 4.1.0+ version of email script. For more
* information on the mail() function for PHP, see
* http://www.php.net/manual/en/function.mail.php
\***************************************************/


// First, set up some variables to serve you in
// getting an email. This includes the email this is
// sent to (yours) and what the subject of this email
// should be. It's a good idea to choose your own
// subject instead of allowing the user to. This will
// help prevent spam filters from snatching this email
// out from under your nose when something unusual is put.

$sendTo = "eric.shomer@gmail.com";
$subject = "Web Site Reply";

// variables are sent to this PHP page through
// the POST method. $_POST is a global associative array
// of variables passed through this method. From that, we
// can get the values sent to this page from Flash and
// assign them to appropriate variables which can be used
// in the PHP mail() function.


// header information not including sendTo and Subject
// these all go in one variable. First, include From:
$headers = "From: " . $_POST["name"] ." ". $_POST["email"] . "<" . $_POST["phone"] .">\r\n";
// next include a replyto
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
// often email servers won't allow emails to be sent to
// domains other than their own. The return path here will
// often lift that restriction so, for instance, you could send
// email to a hotmail account. (hosting provider settings may vary)
// technically bounced email is supposed to go to the return-path email
$headers .= "Return-path: " . $_POST["email"];

// now we can add the content of the message to a body variable
$message = $_POST["message"];


// once the variables have been defined, they can be included
// in the mail function call which will send you an email
mail($sendTo, $subject, $message, $headers);

?>
  1. this.stop();
  2. // -------------------<send form LoadVars>------------------- \
  3. var gatherForm:LoadVars = new LoadVars();
  4. var receiveForm:LoadVars = new LoadVars();
  5. receiveForm.onLoad = function() {
  6.     if (this.response == "passed") {
  7.         name_txt.text = "";
  8.         email_txt.text = "";
  9.         phone_txt.text = "";
  10.         msg_txt.text = "";
  11.         trace("email sent");
  12.         gotoAndStop("correct");
  13.     }
  14. };
  15. function sendForm() {
  16.     gatherForm.email_to = "eric.shomer@gmail.com";
  17.     gatherForm.visitor_comments = msg_txt.text;
  18.     gatherForm.visitor_name = name_txt.text;
  19.     gatherForm.visitor_email = email_txt.text;
  20.     gatherForm.visitor_phone = phone_txt.text;
  21.     // You may want to try the absolute http to this file i.e. http://www.mydomain.com/form.php 
  22.     // If you are testing on the local system and it doesn't know how to parse php,
  23.     // you'll never get a response back from the file.
  24.     gatherForm.sendAndLoad("http://www.bodyshopfitnesscenter.com/email.php", receiveForm, "POST");
  25. }
  26. // -------------------</send form LoadVars>------------------- \
  27. //--------------------<submit button AS>---------------------\
  28. // onRelease
  29. submitBtn.onRelease = function() {
  30.     if (email_txt.text == "" || phone_txt.text == "" || name_txt.text == "" || msg_txt.text == "") {
  31.         gotoAndStop("error");
  32.     } else {
  33.         sendForm();
  34.     }
  35. };
  36. //--------------------</submit button AS>---------------------\
  37. <?php
  38. /***************************************************\
  39. * PHP 4.1.0+ version of email script. For more
  40. * information on the mail() function for PHP, see
  41. * http://www.php.net/manual/en/function.mail.php
  42. \***************************************************/
  43. // First, set up some variables to serve you in
  44. // getting an email. This includes the email this is
  45. // sent to (yours) and what the subject of this email
  46. // should be. It's a good idea to choose your own
  47. // subject instead of allowing the user to. This will
  48. // help prevent spam filters from snatching this email
  49. // out from under your nose when something unusual is put.
  50. $sendTo = "eric.shomer@gmail.com";
  51. $subject = "Web Site Reply";
  52. // variables are sent to this PHP page through
  53. // the POST method. $_POST is a global associative array
  54. // of variables passed through this method. From that, we
  55. // can get the values sent to this page from Flash and
  56. // assign them to appropriate variables which can be used
  57. // in the PHP mail() function.
  58. // header information not including sendTo and Subject
  59. // these all go in one variable. First, include From:
  60. $headers = "From: " . $_POST["name"] ." ". $_POST["email"] . "<" . $_POST["phone"] .">\r\n";
  61. // next include a replyto
  62. $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
  63. // often email servers won't allow emails to be sent to
  64. // domains other than their own. The return path here will
  65. // often lift that restriction so, for instance, you could send
  66. // email to a hotmail account. (hosting provider settings may vary)
  67. // technically bounced email is supposed to go to the return-path email
  68. $headers .= "Return-path: " . $_POST["email"];
  69. // now we can add the content of the message to a body variable
  70. $message = $_POST["message"];
  71. // once the variables have been defined, they can be included
  72. // in the mail function call which will send you an email
  73. mail($sendTo, $subject, $message, $headers);
  74. ?>
  • Anonymous
  • Bot
  • No Avatar
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Mars 14th, 2007, 10:38 am

  • e.s.guardian
  • Newbie
  • Newbie
  • No Avatar
  • Inscription: Mar 14, 2007
  • Messages: 8
  • Status: Offline

Message Mars 14th, 2007, 5:04 pm

preneurs de tout?
  • IceCold
  • Guru
  • Guru
  • Avatar de l’utilisateur
  • Inscription: Nov 05, 2004
  • Messages: 1254
  • Loc: Ro
  • Status: Offline

Message Mars 14th, 2007, 11:49 pm

1. u a écrit:
gatherForm.sendAndLoad ( "p http://www.bodyshopfitnesscenter.com/email.ph", receiveForm, "POST"); -> theres un espace entre "email.ph" et "p".
Si vous copiez-collez ce code dans votre fichier flash, puis retirez mieux l'espace.
2. est http://www.bodyshopfitnesscenter.com/email.php réellement envoyer des emails? Essayez-le avec un formulaire HTML simple, avec action = "http://www.bodyshopfitnesscenter.com/email. php "
qui a 3 textes d'entrée nommée: nom, email, téléphone...et un bouton de soumission.
3. Vous envoyez à PHP:
Code: [ Select ]
  gatherForm.email_to = "eric.shomer@gmail.com";
  gatherForm.visitor_comments = msg_txt.text;
  gatherForm.visitor_name = name_txt.text;
  gatherForm.visitor_email = email_txt.text;
  gatherForm.visitor_phone = phone_txt.text;
  1.   gatherForm.email_to = "eric.shomer@gmail.com";
  2.   gatherForm.visitor_comments = msg_txt.text;
  3.   gatherForm.visitor_name = name_txt.text;
  4.   gatherForm.visitor_email = email_txt.text;
  5.   gatherForm.visitor_phone = phone_txt.text;

mais le code php attendons seulement le nom, l'email et téléphone -> voir $ _POST [ "nom"], $ _POST [ "email"], $ _POST [ "phone"]
donc soit vous changez des fichiers PHP pour obtenir le corriger les variables publiées nom, ou si vous modifiez le fichier Flash
4. si le PHP et des fichiers SWF ne sont pas dans le même domaine, il pourrait y avoir chanches l'e-mail ne sera pas envoyé car le serveur SMTP de mai se limiter à la même domaine. Si elles sont dans le même domaine, alors mieux utiliser le chemin relatif au lieu du chemin absolu: «http://www.bodyshopfitnesscenter.com/email.php"
5. Si vous souhaitez afficher le succès / échec de l'envoi du message, puis vous devrez envoyer réellement quelque chose en retour à clignoter, en utilisant:
echo "response = passé"; / / -> si succès
ou
echo "response = failed"; / / -> si échec
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • billlly
  • Born
  • Born
  • No Avatar
  • Inscription: Juin 16, 2009
  • Messages: 1
  • Status: Offline

Message Juin 16th, 2009, 2:41 am

Eeeks ce qu'est un cornichon belle des réponses, mais je pense que notre ami a des problèmes avec la base. Nice chaînes de fantaisie code sont cool, mais seulement l'envoi de votre e-mail à droite 3 lignes de script sont tout ce que vous devez alors vous ne serez pas lié à quelque chose quand rien ne fonctionne pas jeter un coup d'oeil à ce flash gratuit de messagerie électronique sous forme de PHP, vous pouvez le voir ce n'est pas si difficile d'envoyer des e mails avec flash et PHP:]
Source est gratuit.

Jetez un coup d'œil sur le code dans le fichier source, mais pas beaucoup, il travaille tout le temps. : ]

à charge
http://electronwebdesign.com/e.mail.form.zip


site
http://www.electronwebdesign.com/
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • Avatar de l’utilisateur
  • Inscription: Mai 28, 2003
  • Messages: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Message Juin 16th, 2009, 5:18 am

Ses deux ans après Billy. Je suppose theyve résolu maintenant.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.

Afficher de l'information

  • Total des messages de ce sujet: 5 messages
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 46 invités
  • Vous ne pouvez pas poster de nouveaux sujets
  • Vous ne pouvez pas répondre aux sujets
  • Vous ne pouvez pas éditer vos messages
  • Vous ne pouvez pas supprimer vos messages
  • Vous ne pouvez pas joindre des fichiers
 
 

© 2011 Unmelted, LLC. Ozzu® est une marque déposée de Unmelted, LLC