RON_ron Posted August 5, 2009 Share Posted August 5, 2009 I've done my SUBMIT FORM using Flash. My question is How do I write the PHP server script to get the text which is in a Dynamic Textbox? [code]<?PHP $to = mail@mail.net; $subject = "SUBJECT SUBJECT"; $headers = "From:" .$email."\r\n"; $headers .= "Bcc: $email\r\n"; $message = "Name: " . $thename; $message .= "\n\nAddress: " . $theaddress; $sentOk = mail("$to",$subject,$message,$headers); echo "sentOk=" . $sentOk; This is a part of my current script. I get all the INPUT TEXTBOX data but I need to receive the text which is in few dynamic textboxes as wel. How should I code it? Quote Link to comment Share on other sites More sharing options...
trq Posted August 5, 2009 Share Posted August 5, 2009 You will find your values within either the $_POST or $_GET arrays depending on what method you used to send the data from flash. Quote Link to comment Share on other sites More sharing options...
RON_ron Posted August 5, 2009 Author Share Posted August 5, 2009 var senderLoad:LoadVars = new LoadVars(); var receiveLoad:LoadVars = new LoadVars(); sender.onRelease = function () { senderLoad.thename = thename.text; senderLoad.thecompany = thecompany.text; senderLoad.themessage = themessage.text; senderLoad.sendAndLoad("http://web.com/send.php",receiveLoad); } receiveLoad.onLoad = function () { if(this.sentOk) { _root.gotoAndStop("success"); } else { _root.gotoAndStop("failed"); } } This s my Flash code. Quote Link to comment Share on other sites More sharing options...
trq Posted August 5, 2009 Share Posted August 5, 2009 This s my Flash code And this is a PHP forum. Assuming sendAndLoad() send using GET by default, the data you are looking for will be within phps' $_GET array. eg; $_GET['thename']; $_GET['thecompany']; $_GET['themessage']; Quote Link to comment Share on other sites More sharing options...
RON_ron Posted August 5, 2009 Author Share Posted August 5, 2009 This is a from done in flash. yep I use the PHP code shown to get data to my mail. All the text boxes in my submit form are INPUT TEXTBOXES and the above code works perfectly!! But here I've got a DYNAMIC TEXTBOX which loades the data from an EXTERNAL INPUT TEXTBOX. Therefore I'm unable to use the coding (shown below). $message = "LANGAUGE: " . $thelang; I'm seeking advice on how to get the script written so the data in the DYNAMIC TEXTBOX could be sent to the server side PHP and back to my mail. Quote Link to comment Share on other sites More sharing options...
RON_ron Posted August 6, 2009 Author Share Posted August 6, 2009 I don't know whether my queston is not very clear. Here I go again. I've done a website ibn FLASH. page 1 is to fll in a section of data (text) and on page 2 is the submit form. On page 1 I've got a INPUT textbox (my_Input_Txt) On page 2 I've got a DYNAMIC textbox (my_dyn1) my_dyn1 receives the data (text) from my_Input_Txt.onChanged = function() { _root.my_dyn1.text = my_Input_Txt.text; MY QUESTON IS - How do I write the PHP server script to get the text which is in a Dynamic Textbox (my_dyn1)? My php server side script works fine with all the INPUT text fields i've got in my submit form. But how do I get the text in my_dyn1 to my mail? My PHP Code: <?PHP $to = "mail@.com"; $subject = "subj"; $headers = "From:" .$email."\r\n"; $headers .= "Bcc: $email\r\n"; $message = "Name: " . $thename; $message .= "\n\nMY TEXT: " . $dyn_text1; $sentOk = mail("$to",$subject,$message,$headers); echo "sentOk=" . $sentOk; >? AS var senderLoad:LoadVars = new LoadVars(); var receiveLoad:LoadVars = new LoadVars(); sender.thename= thename.text; senderLoad.dyn_text1 = dyn_text1.text; senderLoad.sendAndLoad("wwws/send.php",receiveLoad); } receiveLoad.onLoad = function () { if(this.sentOk) { _root.gotoAndStop("success"); } else { _root.gotoAndStop("failed"); } } I'm not receiving the dyn_text1 data!!! Quote Link to comment Share on other sites More sharing options...
trq Posted August 6, 2009 Share Posted August 6, 2009 Your question obviously is flash related not php. All the variables you are sending will be found either within $_POST or $_GET in php. How you send them is a flash question. have you done a print_r($_POST) or print_r($_GET) in php to see what is being sent to your script? Quote Link to comment Share on other sites More sharing options...
RON_ron Posted August 6, 2009 Author Share Posted August 6, 2009 No I haven't. I'm not a PHP guy. But I need to know why isn't my dynamic text box data is NOT transfering to my mail. is my PHP script correct? if so I'd atleast know that the fault is in the AS. Thanks thorpe! Quote Link to comment Share on other sites More sharing options...
trq Posted August 6, 2009 Share Posted August 6, 2009 Your php script is not correct, I'm not sure however how many times you need to be told that the data you are looking for is within the $_POST or $_GET arrays. eg; Instead of.... $message .= "\n\nMY TEXT: " . $dyn_text1; You need.... $message .= "\n\nMY TEXT: " . $_GET['dyn_text1']; or.... $message .= "\n\nMY TEXT: " . $_POST['dyn_text1']; depending on what method you use to send data from flash. Quote Link to comment Share on other sites More sharing options...
RON_ron Posted August 6, 2009 Author Share Posted August 6, 2009 OMG.... as you said both scripts were correct and I just realized my text box was in another layer!!!!! PROBLEM SOLVED!! Thanks and extreamly sorry for been babish with a dumb queston . My eyes simply could not catch the error and I was very much worried!! Just one more simple thing, The seperations isn't correct $message .= "\nText Positionings: " . $MDT1, $MDT2, $MDT3; How to write the PHP code so the mail I receive looks something like this. Text Positionings: ABC, XZY, LMO Quote Link to comment Share on other sites More sharing options...
mattal999 Posted August 6, 2009 Share Posted August 6, 2009 OMG.... as you said both scripts were correct and I just realized my text box was in another layer!!!!! PROBLEM SOLVED!! Thanks and extreamly sorry for been babish with a dumb queston . My eyes simply could not catch the error and I was very much worried!! Just one more simple thing, The seperations isn't correct $message .= "\nText Positionings: " . $MDT1, $MDT2, $MDT3; How to write the PHP code so the mail I receive looks something like this. Text Positionings: ABC, XZY, LMO $message .= "\nText Positionings: " . $MDT1 . "," . $MDT2 . "," . $MDT3; Quote Link to comment Share on other sites More sharing options...
RON_ron Posted August 6, 2009 Author Share Posted August 6, 2009 Perfect!! Thanks Matt. 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.