473,480 Members | 2,325 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Flash stronger then PHP?

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

Aug 9 '07 #1
4 1517
On Aug 9, 7:54 pm, vinnie <centro.ga...@gmail.comwrote:
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.

Aug 10 '07 #2
check our AMFPHP, works much smoother and allows your flash to talk
directly to your php objects - READ THE INSTRUCTIONS, its a bid weird
settign it up.

Phil

Aug 10 '07 #3
vinnie wrote:
$senderMail = $_REQUEST["snderMail"];
$senderMail = $_REQUEST["senderMail"];
$header = "From: $senderName <senderMail>\br";
$header .= "Replay-To: $senderName <senderMail>\br";
$header = "From: $senderName <$senderMail>\r\n";
$header .= "Reply-To: $senderName <$senderMail>\r\n";

Possibly other errors too.

By the way, this script has big security holes and may lead to your server
being blacklisted.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 50 days, 16:12.]

Command Line Interfaces, Again
http://tobyinkster.co.uk/blog/2007/0...nd-line-again/
Aug 10 '07 #4
On Aug 10, 8:19 am, Phil <ppalmi...@page12.comwrote:
check our AMFPHP, works much smoother and allows your flash to talk
directly to your php objects - READ THE INSTRUCTIONS, its a bid weird
settign it up.

Phil
Thanks Phil,
What is AMFPHP?

Aug 10 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
8554
by: Keith Rowe | last post by:
Hello, I am trying to reference a Shockwave Flash Object on a vb code behind page in an ASP.NET project and I receive the following error: Guid should contain 32 digits with 4 dashes...
9
667
by: Keith Rowe | last post by:
Hello, I am trying to reference a Shockwave Flash Object on a vb code behind page in an ASP.NET project and I receive the following error: Guid should contain 32 digits with 4 dashes...
8
5867
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
8
1741
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
0
6915
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7054
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7097
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2993
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.