You are here: Flash stronger then PHP? « PHP Programming Language « IT news, forums, messages
Flash stronger then PHP?

Posted by vinnie on 08/09/07 23:54

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://PATH TO MY SERVER/sendMail.php",
sendMail_lv, "POST");
}

Thanks a lot.
Vinnie

 

Navigation:

[Reply to this 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

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