Reply to Re: Flash stronger then PHP?

Your name:

Reply:


Posted by Fred on 08/10/07 03:16

On Aug 9, 7:54 pm, vinnie <centro.ga...@gmail.com> wrote:
> I have tried several times to make the flash website to communicate
> with the PHP script i have on the server, but it does not work. It
> should work in this way: when the fields on the forms are all "not
> blank" send the mail. The PHP then should be in charge to send the
> email to the destination address.
>
> The files are:
>
> PHP (server side):
>
> <?php
> // get the externl variables
> $destMail = $_REQUEST["destMail"];
> $senderName = $_REQUEST["senderName"];
> $senderMail = $_REQUEST["snderMail"];
> $senderSubject = $_REQUEST["senderSubject"];
> $senderBody = $_REQUEST["senderBody"];
> // add header info
> $header = "From: $senderName <senderMail>\br";
> $header .= "Replay-To: $senderName <senderMail>\br";
> // invio della mail: destinatario, subject, coprpo della mail, header
> mail($destMail, $senderSubject, $senderBody, $header);
> ?>
>
> While the FLASH script is:
>
> fieldsFilled = new Object();
> fieldsFilled.onKeyUp = function()
> {
> if (destMail_txt.text != '' && senderName_txt.text != '' &&
> senderMail_txt.text != '' && senderSubject_txt.text != '' &&
> senderBody_txt.text != '') {
> send_btn.enabled = true;
> }
> else
> {
> send_btn.enabled = false;
> }}
>
> Key.addListener(fieldsFilled);
> send_btn.enabled = false;
> var sendMail_lv:LoadVars = new LoadVars();
> send_btn.onRelease = function()
> {
> sendMail_lv.destMail = destMail_txt.text;
> sendMail_lv.senderName = senderName_txt.text;
> sendMail_lv.senderMail = senderMail_txt.text;
> sendMail_lv.senderSubject = senderSubject_txt.text;
> sendMail_lv.senderBody = senderBody_txt.text;
> // invio i dati tramite sedandload
> sendMail_lv.sendAndLoad("http://PATHTO MY SERVER/sendMail.php",
> sendMail_lv, "POST");
> }
>
> Thanks a lot.
> Vinnie

my understanding is that the variables recieved should look like this
$destMail = $_POST["destMail"];
and so on. you can always use the following script to make sure that
your send the varibles to php...
<?php
foreach ($_POST as $key=>$value) {
$received .= "$key = $value\r\n";
}

$printout = fopen("variables.txt", "w");
fwrite($printout, $received);
fclose($printout);
?>

That will list the varibles passed to it from flash. Hope this helps.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация