Jeanine_F Posted December 12, 2009 Share Posted December 12, 2009 I hope someone can help me - I've been struggling for hours! I built an input form in Flash (mx 2004) and wrote a php file with variables and echo commands: The php displays the .swf e-card on my website, but the text is not there, only the quote displays (it doesnt run!) This is what I did: Please tell me what I did wrong? <html><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width=550 height=400> <param name=movie value="3008.swf?from=<?php echo $from; ?>&to=<?php echo $to; ?>&message=<?php echo $message; ?> "> <param name=quality value=high> <param name=bgcolor value=#FFFFFF> <embed src="3008_form.swf?from=<?php echo $from; ?>&to=<?php echo $to; ?>&message=<?php echo $message; ?> " quality=high bgcolor=#FFFFFF width=550 height=400 type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </embed> </object> Quote Link to comment Share on other sites More sharing options...
GFXUniverse Posted December 12, 2009 Share Posted December 12, 2009 (I couldn't understand how u r storing values into variables such as $message $to etc. may b u included any file) anyway the code u posted, i found this problem mostly u didn't add correctly php open tag i.e <?php you just put ?php you must not forget ' < ' Quote Link to comment Share on other sites More sharing options...
Buddski Posted December 12, 2009 Share Posted December 12, 2009 Can you show us the output source from your browser.. It might help shed a little more light.. And you havent missed the '<' on the PHP, it has been converted into its character entity.. This could be in your code or something that has happened when you copied it onto the forum. Seeing the source will help.. Quote Link to comment Share on other sites More sharing options...
Jeanine_F Posted December 12, 2009 Author Share Posted December 12, 2009 Hi GFX Thanks! I fixed it, but it's still not working. To answer your question - The viarables are called "to", "from"ect in the flash form and the values in the output .swf is the same. (is that a problem?) this is supposed to be an e-card where you can record a message and it is posted to my site) I actually want the e-card to be mailed to someone, but I havent even gotten to the point of figuring that out!! The code is now: <html><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width=550 height=400> <param name=movie value="3008.swf?from=<?php echo $from; ?>&to=<<?php echo $to; ?>&message=<<?php echo $message; ?> "> <param name=quality value=high> <param name=bgcolor value=#FFFFFF> <embed src="3008_form.swf?from=<?php echo $from; ?>&to=<<?php echo $to; ?>&message=<<?php echo $message; ?> " quality=high bgcolor=#FFFFFF width=550 height=400 type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </embed> </object> Quote Link to comment Share on other sites More sharing options...
Jeanine_F Posted December 13, 2009 Author Share Posted December 13, 2009 Hi Buddski, This is what I get on my website: http://www.3tribes.co.za/3008/3008.php (after adding the < ) Before the < , I just saw the code in the text boxes Quote Link to comment Share on other sites More sharing options...
trq Posted December 13, 2009 Share Posted December 13, 2009 Where do you define $from, $to and $message? Quote Link to comment Share on other sites More sharing options...
Jeanine_F Posted December 13, 2009 Author Share Posted December 13, 2009 Hi Thorpe I defined it in a Flash form - Is that what you mean? Quote Link to comment Share on other sites More sharing options...
Buddski Posted December 13, 2009 Share Posted December 13, 2009 The way you have your code structured will allow you to pass IN variables to flash from PHP.. If $to, $from and $message arent defined in the PHP they will not be passed into your flash form.. I think you are wanting to send things FROM flash to PHP? Correct? Quote Link to comment Share on other sites More sharing options...
Jeanine_F Posted December 13, 2009 Author Share Posted December 13, 2009 Correctísh... I have 3 files 3008_form.swf (first file where I made input text boxes in Flash), this pops up and the user enters details (to, from and message) then 3008.php (the code that I pasted above) From this file I want to send the answers to the above 3 questions to another Flash file: 3008.swf (where I created dynamic text boxes in Flash.) that is the file that is visible on the link I posted Quote Link to comment Share on other sites More sharing options...
GFXUniverse Posted December 13, 2009 Share Posted December 13, 2009 you must first tell the php to get the values for variables that sent from flash form and then echo them $mesage $to etc. are undefined variables example: <?php //using POST Method $message = $_POST["message"]; //"message" is the name that u set for input field in flash form echo $message; ?> Quote Link to comment Share on other sites More sharing options...
Jeanine_F Posted December 13, 2009 Author Share Posted December 13, 2009 GFX - I tried it with no luck - doesnt POST and echo have the same function? As far as I know it is a matter of preference? Quote Link to comment Share on other sites More sharing options...
Jeanine_F Posted December 13, 2009 Author Share Posted December 13, 2009 The action script I used on the submit button in the first flash form is: on (release) { getURL("http://www.3tribes.co.za/3008/3008.php","_blank","GET"); } Quote Link to comment Share on other sites More sharing options...
GFXUniverse Posted December 13, 2009 Share Posted December 13, 2009 then Edit $message = $_GET['message']; for PHP file OR on (release) { getURL("http://www.3tribes.co.za/3008/3008.php","_blank","POST"); } for Flash Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.