Jump to content

PHP server side script


RON_ron

Recommended Posts

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 = [email protected];

$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?

Link to comment
https://forums.phpfreaks.com/topic/168916-php-server-side-script/
Share on other sites

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.  8)

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.

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 = "[email protected]";

 

$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!!!

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.

OMG.... as you said both scripts were correct and I just realized my text box was in another layer!!!!!  :facewall:

 

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!!  :D

 

 

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

OMG.... as you said both scripts were correct and I just realized my text box was in another layer!!!!!  :facewall:

 

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!!  :D

 

 

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;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.