PDA

View Full Version : How to send information from txt box to server?



msjensen
February 1st, 2002, 04:44 PM
How would you send information that a user inputs in a flash text box (such as an e-mail) to a txt file in the server?

this is what I am thinking

Make a dynamic text box and name it "e-mail"
make a button and on the button put this...

on (release) {
loadVariables ("e-mail" , vars=POST)

I am little lost okay am very lost.

Where does it post to, and Do I need to tell it to create a file, and will the file be written over if some else sends something.

All help would be great, because I am lost :(

ilyaslamasse
February 1st, 2002, 07:17 PM
You got it, man. One thing, though : I don't think that you need to actually write vars=POST. POST alone should work. About your following questions, for example if you use PHP, there will be a variable called $email that you'll be able to use as you like : put it in a file, in a DB, or whatever...
pom 0]

msjensen
February 4th, 2002, 09:44 AM
Thanks,

Okay so when it post's what does that do where does it go, and how do I access the post?

First time doing this thank you for helping,
Matt

ilyaslamasse
February 4th, 2002, 04:08 PM
Let's take the example of a mailer. Let's say that you put 3 input boxes in your scene, and that you name them "address", "subject" and "message".
You'll have to put a button with the code :
on (release) {
&nbsp &nbsp &nbsp &nbsp loadVariablesNum ("mailer.php", 0, "POST");
&nbsp &nbsp &nbsp &nbsp }

Now let's take a look at that mailer.php file : basically, it's :
<? $mailheaders = "From: <$adress> \n";
&nbsp &nbsp &nbsp &nbsp $mailheaders .= "Reply-To: <$Your_address>\n\n";
&nbsp &nbsp &nbsp &nbsp $msg = "$Message\n\n";
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp // function that sends your message
&nbsp &nbsp &nbsp &nbsp mail($Adr_Envoi, $Sujet, $msg, $mailheaders);
?>

This is basically how you get the data from Flash. To have the whole file, just check a post concerning a mailer somewhere on this board.

pom 0]

msjensen
February 4th, 2002, 04:39 PM
thanks for youe explanation. :)

What I am trying to do is create a mailing list. so a user inputs their e-mail address and then we get it and send them something. With this in mind do I even need to use php? or would it be just easier to use getURL mailto: method?

Thanks for all your help and I will look back at the older post to see if I can glean more information from them

Thanks again,
Matt