473,800 Members | 2,529 Online
Bytes | Software Development & Data Engineering Community
+ 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["senderSubj ect"];
$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.on KeyUp = function()
{
if (destMail_txt.t ext != '' && senderName_txt. text != '' &&
senderMail_txt. text != '' && senderSubject_t xt.text != '' &&
senderBody_txt. text != '') {
send_btn.enable d = true;
}
else
{
send_btn.enable d = false;
}
}
Key.addListener (fieldsFilled);
send_btn.enable d = false;
var sendMail_lv:Loa dVars = new LoadVars();
send_btn.onRele ase = function()
{
sendMail_lv.des tMail = destMail_txt.te xt;
sendMail_lv.sen derName = senderName_txt. text;
sendMail_lv.sen derMail = senderMail_txt. text;
sendMail_lv.sen derSubject = senderSubject_t xt.text;
sendMail_lv.sen derBody = senderBody_txt. text;
// invio i dati tramite sedandload
sendMail_lv.sen dAndLoad("http://PATH TO MY SERVER/sendMail.php",
sendMail_lv, "POST");
}

Thanks a lot.
Vinnie

Aug 9 '07 #1
4 1534
On Aug 9, 7:54 pm, vinnie <centro.ga...@g mail.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["senderSubj ect"];
$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.on KeyUp = function()
{
if (destMail_txt.t ext != '' && senderName_txt. text != '' &&
senderMail_txt. text != '' && senderSubject_t xt.text != '' &&
senderBody_txt. text != '') {
send_btn.enable d = true;
}
else
{
send_btn.enable d = false;
}}

Key.addListener (fieldsFilled);
send_btn.enable d = false;
var sendMail_lv:Loa dVars = new LoadVars();
send_btn.onRele ase = function()
{
sendMail_lv.des tMail = destMail_txt.te xt;
sendMail_lv.sen derName = senderName_txt. text;
sendMail_lv.sen derMail = senderMail_txt. text;
sendMail_lv.sen derSubject = senderSubject_t xt.text;
sendMail_lv.sen derBody = senderBody_txt. text;
// invio i dati tramite sedandload
sendMail_lv.sen dAndLoad("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("variable s.txt", "w");
fwrite($printou t, $received);
fclose($printou t);
?>

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...@page 12.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
8608
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 (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). On the aspx page I have the object tag as follows:
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 (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). On the aspx page I have the object tag as follows:
8
5913
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 clients (Internet Explorer). My flash content was originally brought in via the “flash satay” method, but I have since used some server-side magic do deliver one <objecttag
8
1756
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 clients (Internet Explorer). My flash content was originally brought in via the “flash satay” method, but I have since used some server-side magic do deliver one <objecttag
0
10504
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10274
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
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 we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.