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

Link to comment
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)

Link to comment
Share on other sites

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'];

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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;

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.