Welcome, Guest. Please login or register.
Did you miss your activation email?
05/21/12, 03:17
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  PHP, Perl, ASP, JSP, CFM (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Jorge Solis, nothingGrinder)
| | |-+  flash vars into PHP??????
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: flash vars into PHP??????  (Read 4937 times)
djangokill
Server what's that
*
Posts: 10


Flash-db Rules


View Profile Email
« on: 02/05/02, 12:56 »

   

--------------------------------------------------------------------------------
got a form and PHP backend.

all the variable names are set properly etc and the script runs successfully. I get an email, but the spaces where the variables should be are blank. I have set it up to work with an html form and everything works perfectly.

but for some reason flash isnt passing the variables into the php.

any ideas??

This is the script

<?
$ToEmail = "me@me.com";
$ToName = "Me";
$ToSubject = "Mail";

$EmailBody = "Sent By: $FirstName\nSenders Email: $Email\n\nMessageSent:\n$ToComments\n\n";

$EmailFooter="\nThis message was sent by: $FirstName from $REMOTE_ADDR If you feel that you recieved this e-mail by accident please contact us at www.yourSite.com";    

$Message = $EmailBody.$EmailFooter;

mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName." <".$Email.">");

Print "_root.contact_form.form_fields.EmailStatus=Complete - Your mail has been sent";
?>

and this is on the button

on (release) {
   if (_root.contact_form.form_fields.FirstName eq "") {
       EmailStatus = "Please Enter your name";
   } else if (!_root.contact_form.form_fields.Email.length || _root.contact_form.form_fields.Email.indexOf("@") == -1 ||_root.contact_form.form_fields.Email.indexOf(".") == -1) {
       EmailStatus = "Please enter a valid e-mail address";
   } else if (_root.contact_form.form_fields.ToComments eq "") {
       EmailStatus = "Please enter a message";
   } else {
       loadVariablesNum ("fumemail.php", 0, "POST");
       EmailStatus = "Sending... one moment please";
   }
}


cheers in advance

djangokill
Logged
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« Reply #1 on: 02/05/02, 13:58 »

Hi,

your vars are inside a clip _root.contact_form.form_fields but you are sending from the main timeline. Try
loadvariables("fumemail.php", _root.contact_form.form_fields, POST)

Musicman
Logged
djangokill
Server what's that
*
Posts: 10


Flash-db Rules


View Profile Email
« Reply #2 on: 02/05/02, 14:26 »

cheers Musicman,

the send button and the form fields are all in the same movie clip. and the feedback statement that the PHP generates gets displayed correctly in that same movie clip.

cheers

djangokill
Logged
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« Reply #3 on: 02/05/02, 20:04 »

So it is working then? If not, please tell url to your movie

Musicman
Logged
djangokill
Server what's that
*
Posts: 10


Flash-db Rules


View Profile Email
« Reply #4 on: 02/06/02, 06:07 »

no its not working, the script runs and sends the confirmation message to the flash movie,and i get an email. but the variables are not in the email...


www.fumemedia.port5.com

djangokill
Logged
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« Reply #5 on: 02/06/02, 12:58 »

Hi, I get a 404 - is it something like www.fumemedia.com/thismovie.swf ?

Musicman
Logged
djangokill
Server what's that
*
Posts: 10


Flash-db Rules


View Profile Email
« Reply #6 on: 02/06/02, 13:20 »

sorry, forgot about the www

here it is

http://fumemedia.port5.com/

cheers.
I can get it to receive the variables if I declare the variables as part of the 'else' statement:


   } else {
       FirstName=spoons
       loadVariablesNum ("fumemail.php", 0, "POST");
       EmailStatus = "Sending... one moment please";
   }
}

this sends the email, and sets the senders name as spoons.

but the other variables are not passed.  

i tried declaring the variables like

FirstName=_root.contactform.etc.etc.name (thats what i changed the text field to in order to test this)

any ideas??

cheers

djangokill
Logged
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« Reply #7 on: 02/06/02, 13:38 »

Is there a direct link to your movie as well - your main page is familiar microbians "crash that other browser" script...

Musicman
Logged
djangokill
Server what's that
*
Posts: 10


Flash-db Rules


View Profile Email
« Reply #8 on: 02/06/02, 13:42 »

eh? don't get it...crash that other browser script??

the movie is called hex1.swf

http://fumemedia.port5.com/hex1.html


good luck

djangokill
Logged
djangokill
Server what's that
*
Posts: 10


Flash-db Rules


View Profile Email
« Reply #9 on: 02/06/02, 14:01 »

sorted it

I declare the vars after the else statement.

And now the god damn thing works. After a week of messing about with the damn thing.

Cheers for your efforts.

djangokill
Logged
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« Reply #10 on: 02/06/02, 14:20 »

Hi,

the microbians chromeless thing reliably crashes netscape 4.x browsers

the message sent from the movie to your script sends these vars:
EmailStatus=&FirstName=Musicman&Email=musicman@f2s.com&ToComments=hi,testing your script
(urlencoding removed for better reading)
If you have different results in your mail, this would be a problem with the script

Musicman
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!