Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Problem With LoadVars.send()


Simple problem but potentially crippling...

I'm trying to send large amounts of POST data from my SWF to a PHP script using the send() method of the LoadVars object. When executing the script everytnig goes well (that is, my data successfully gets sent to the PHP script) except that after some arbitrary amount, the data gets cut off.

For example, if I send 200 characters, all characters will successfully be sent to the PHP script. However, if the number of characters bring sent from the SWF exceeds say, 500 characters, the PHP script will only recieve about 450 of them.

Initially I thought this might have something to do with the configuration of my Apache server but it would seem that by default, the maximum amount of POST data that Apache will process is set to unlimited.

My next thought was that Flash was sending data sing the GET method, which aparently caters to a maximum of 250 characters at once, but the documentation insists that the send() method uses the POST method unless otherwise directed. This is not to mention that I am in fact explicitly including the "POST" argument when calling the send() method.

As a final note, it seems strange that even though the documentation insists that send() uses the POST method to send data, the PHP $_POST array is empty when examined after data was sent from the SWF to the script. Very strange indeed...

So here I am now, looking for answers and it would seem that I can't find any solid answers to this problem of mine. Any help/suggestions would be greatly appreciated.

Best,
Ptolemy




FlashKit > Flash Help > Flash MX
Posted on: 03-11-2003, 11:24 PM


View Complete Forum Thread with Replies

Sponsored Links:

LoadVars.send Doesn't Send..
Hi people, It's a LONG time since my last Flash application, I'm just catching up.
I'm trying to build a Flash "driver" for a serverless chat client (this means I'm making it work with a database and a php script, but no socket server, as I don't have the money to have such a hosting that let's me use one).

Anyway, what I'm trying to do is to get Flash to query the php script, sending some data (like channel id, user id etc..) and retrieve the new messages.

I have debugged the php script and I can assure the problem is not there.
The script prints whatever request arguments it recieves into comments in the response page.

What I'm doing in flash is:

code:
Request = new LoadVars();
Request.my_var = "foo";
Request.send("http://blablabla....php", "_blank", "POST");


The darn thing doesn't send anything to the php script.
I've already seen that it is possible to add variables to the url string, and they get passed to the script, but I don't want to get so dirty...plus I want to use POST, because of potentially long messages being passed.

Does anyone know anything about this?

Gosh I have it when Flash comes to such stupid problems.
Php rules!

If I don't get it right within a few hours, I'll just build the whole thing in Javascript. I just don't want to have to build it for each and every browser on the web...

Cheers!

View Replies !    View Related
Page 2 - LoadVars.send Won't Send
It occurs to me that 'send' is not as useful and rarely better to use than 'sendAndLoad'. Even if you do not intend to use any returned variables, the 'sendAndLoad' method will notify Flash that your server side script has processed the information correctly.

Just check this commented code out and I think you will agree this is much better...


Code:


// Success/Failure function sends user on to new frame when called
test = function (success){
if (success){
gotoAndPlay("loaded");}
else{
gotoAndPlay("failed");
}
};

update=new LoadVars(); // create new LoadVars object called 'update'
update.data="value"; // assign the variable 'data' to the new LoadVars object
update.onLoad=test; // call the test function when the transfer is complete
update.sendAndLoad("update.php", reply, "POST"); // begin the transfer
stop(); // stop the movie (continues on calling the 'test' function)



In my example above is the 'sendAndLoad' line:

update.sendAndLoad("update.php", reply, "POST");

1. 'update.sendAndLoad' sends our 'update' LoadVars object.
2. 'update.php' is our script.
3. 'reply' is the LoadVars object any results will be returned in.
4. 'POST' is our method.

...as you can see, if the script processes the data correctly it will return a successful operation to Flash, where you can then continue your movie. It will also return a non-successful operation and allow you to forward to a Flash frame with some form of error message (which I think should be a requirement of any data transfer).


That would be the best advice I could offer, but if you are adamant about using just a 'send' command... try using your LoadVars object instead of a window target, as I think its is very odd the same object is apparently using different methods...

data.send("save2.pl", data, "POST");

Yeah, btw surely its 'POST' not 'GET' ...some data send/load objects will not work with the 'GET' method, so its wise to stick to 'POST' unless its necessary not too.

View Replies !    View Related
Help LoadVars.send Vs. LoadVars.sendAndLoad
OK, my understanding is that if example 1 works so too should example 2:

Example 1:var my_lv:LoadVars = new LoadVars();
my_lv.overall_score = _root.overall_score;
my_lv.send("score.php", _blank, "GET");
Example 2:var my_lv:LoadVars = new LoadVars();
my_lv.overall_score = _root.overall_score;
my_lv.sendAndLoad("score.php", result_lv, "GET");
My understanding is however clearly wrong as example 1 will pass the variable quite happily to my php script which will update appropriately. In example 2, nothing. Nada. Variables aren't availabe to php and (therefore unsurprisingly) my_lv.onload isn't picking up any return.

Where am I going wrong this time?!

Cheers,
Andrew

View Replies !    View Related
LoadVars.send VS LoadVars.sendAndLoad
Last edited by gkcohen : 2004-04-23 at 09:19.
























can someone tell me what the difference is with these two. here is my problem. i am trying to submit some info to php script. i have my variables in text file.

if if loadVars.load("textFile.txt");
and then say loadVars.send(url, "_blank", "post") then it will work. but i dont want to load the resulting php page outside of flash. if instead i do loadVards.sendAndLoad(url, dataReceiver, "post") then it will not work. my dataReceiver will return blank, or i will get an error that the variables were not sent.

i guess that you cant loadVar from a text file and then use it with sendAndLoad, is that right?

the reason for using the text file is the real problem. the php script requires a variable 'group_ids[]' with an integer for a value. apparently, flash cant read the variable with the '[]' in it. i have tried different ways to get it formatted, but it wont work. i tried do something like loadVars.group_ids + "[]" = 1 but i get message stating the the object to the left of the operand must be a variable.

my only fix was to use a text file to load this variable. it works, but only when using the send and having a php srcipt popup.

i am not too familiar with php to modify the scipt, and i think that variable needs to be an array.

i dont know what else to do. HELP

gkc

View Replies !    View Related
LoadVars.send Won't Send
I've been following this tutorial from actionscript.org as well as the reference from macromedia on how to use LoadVars to load variables from a text file into an object. I'm quite satisifed with how it loads, but I have been unable to use the ".send" aspect of it.

I'm starting to get really confused, since another thread on the board says that flash alone can not write variables to a text file.

My .FLA file can be found here, and my variable file can be found here.

(a short explanation for those that view the .fla: the movie loads the IP values from a text file, and the user is supposed to put a word in the input box next to each one. The input box refers to the variable within the "data" object, and when trace is used it shows that the values are updated for those variables, yet it still won't write to file.)

Please help me out, since this is my final art project for this semester and I'm really hoping on presenting it this monday.

View Replies !    View Related
LoadVars.send
I can't use loadvariables for my script, and loadVars.send pops us an IE window, with the script address, after the vars have been loaded.
Is there a way to avoid it? (avoiding the target frame param for server response doesn't help)

View Replies !    View Related
Loadvars.send()
every time i use loadvars.send() it always open a new window , how can i omit the opening window? any suggestion? thanks!

View Replies !    View Related
?loadVars.send With Asp?
Hiya,

could anyone run an eye over this script? its purpose is simply to send out an http header to an asp script. Am I using this object correctly?

---------------------------------------------------------------------------------------
on (press) {
header = new LoadVars();
headerstr =
"?lable1="+_root.firstname+
"&lable2="+_root.lastname+
"&lable3="+_root.address1+
"&lable4="+_root.address2+
"&lable5="+_root.address3+
"&lable6="+_root.postcode+
"&lable7="+_root.emailad+
"&label8="+_root.age;
header = headerstr;
header.send("http://www.nslaved.com/contact.asp",GET);
}
on (release) {
gotoAndStop(2);
}
----------------------------------------------------------------------------------------

all the _root.firstname etc. are input textfield var names.
Oh yes, and is this use of " + " recommended?

whadyathink?

A word or two of advice would be greatly appreciated,

Cheers,

Scott

View Replies !    View Related
LoadVars Send?
Hi,
I wan't to send some information to a php page that will transfer this to mySQL, I don't need a response so I used the Send function. But for some reason this pops up the php page in a new window. Can I get around that in any way, cause I don't wan't the page to pop up?
Cheers!
Magnus

View Replies !    View Related
LoadVars.send()
Hi, i try to make following:
I will control, if anybody visit my site with email notifikation.

1. I want in movie built script with LoadVars.send() or something similar to send for ASP page info (my variable), that now had anybody loaded this flash movie.
2. Then will be the ASP send email to me with following script:

//time_of_visit is variable, which will be loaded from my movie


Code:
<%
var_mail = request.form("time_of_visit")
set Mail = Server.CreateObject("CDONTS.NewMail")
Mail.From = "postmaster@flashmedia.cz"
Mail.To = "info@flashmedia.cz"
Mail.Subject = "Somebody loaded my movie"
Body ="°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°" & chr(13) & chr(10)
Body = Body & var_body & chr(13) & chr(10)
Body =Body & "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°" & chr(13) & chr(10)
Mail.Body = Body
Mail.Send
set objRST = nothing
set Mail = nothing
%>
The problem is, that i can´t still send variables to ASP page with LoadVars object.
Before i used e.g.
Code:
_root.loadVariables ("../forms/save_visitor.asp", "POST");
It worked, but i want to learn this LoadVars object.

In my book is'nt good explained.

Thanks Jan

View Replies !    View Related
LoadVars.send
I am desperate!!!!!!!!!!!!!!!!!

I have been trying to send information to a data base. i have tried the following:
getURL("http://scadev.kmionline.com/staemodules/emod108/m01/quizposter.asp?topicname=Organization%20Fundamenta ls&quizname=quiz1&quizscore="+q1answer, "
", "POST");

when i use this the information gets to the data base but opens another window. i don't want a response back.

so i tried:
var lv:LoadVars = new LoadVars();
lv.topicname = "Organization%20Fundamentals";
lv.quizname = "quiz1";
lv.quizscore = q1answer;//variable for the total score of quiz
lv.send("http://scadev.kmionline.com/staemodules/emod108/m01/quizposter.asp", "POST");

this does nothing.

i need to be able to send the information with out is opening another window or give me a response.

please, any help will be appreciated. thanks
dawn

View Replies !    View Related
LoadVars() ..... .send
ok I have a basic text echo text box (to try to get the damn .send methods to work)
frame one makes a new loadvars object by
I'm using flash 5 so I don't know if the old flash is a problem.


Quote:




text = new LoadVars()




then when they press enter (or the enter button) it goes to frame two where I have


Quote:




text = _root.input;
text.send("input_text.php" , "POST")
_root.input = "";




which makes the text loadvars object equal to whatever they typed in in the input box, and sends it to my php script, and then clears the input box for new input. However my php script or the send function are having trouble getting the damn variables. When I use getURL it works fine ( i recieve a text variable and an input variable in php with the same value, what the user put in) BUT I don't want it to use getURL, I want to use the text object I made. Am I doing something wrong? my php program writes whatever it gets to a text file, permissions are correct because I changed them all to work with getURL, but they dont work with send.

I'm so close but somthing is not right, help!

View Replies !    View Related
LoadVars.send() How To Use It?
I use for sending variables this:

Code:
this.loadVariables("../forms/singup.asp", "POST");


How can i use LoadVars class for sending variables?

Thanks

View Replies !    View Related
LoadVars.send() Help
I'm a little confused about how LoadVars.send() works. I have a form in Flash that has a text field (txtName) whose input I want to send to an ASP page.

btnSubmit.onRelease = function(){
var my_lv:LoadVars = new LoadVars();
my_lv.teacherName = txtName.text;
my_lv.send("http://www.mywebsite.com/test.asp", "_blank", "POST");
}


I guess my first question is my code correct? And my second question is what happens after this code is executed? Does it automatically run the script on my asp page without ever having to navigate to it? On my asp page I just have Name=Request.Form("teacherName") and then I insert that value into the DB.

View Replies !    View Related
Using Loadvars.send
Just wondering, if I have a text file with say... line1= &line2= &line3= etc, and I want to make a flash file with a button that will input stuff into this text file, what code will I need to use??

View Replies !    View Related
Loadvars() Send
Hi

i have made a login which send a email when a users logs in it loads some variables with this code and send them to email.php:

Code:
mail_vars = new LoadVars();
mail_vars.name1 = name1;
mail_vars.email = email;
mail_vars.body = body;
mail_vars.send("email.php", "POST");
after reaching the frame it send the email correctly and pop-up a blank window. So i read on the form that if you make the code like this it wont
pop -up:

Code:
mail_vars = new LoadVars();
mail_vars.name1 = name1;
mail_vars.email = email;
mail_vars.body = body;
mail_vars.send("email.php",newEmail,"POST");
but then it refuse to send the email someone got any idea searched the net for a day now without succes

thnx

View Replies !    View Related
LoadVars.Send To ASP
Hellow,

I'm trying to send content from flash to asp, but I dont know how to request for the data in asp,

This is my AScode:


Code:
var myLv:LoadVars = new LoadVars()
myLv.vr1 = vr1
myLv.vr2 = vr2
myLv.vr3 = vr3
myLv.zenderNaam = naam_txt.text
myLv.zenderEmail = email_txt.text
//
myLv.send("wedstrijd.asp","_blank","POST")
Anyone knows to call for these in asp?

thnxs!

View Replies !    View Related
Using Loadvars.send
Just wondering, if I have a text file with say... line1= &line2= &line3= etc, and I want to make a flash file with a button that will input stuff into this text file, what code will I need to use??

View Replies !    View Related
Tracing LoadVars.send?
Hiya,

Can anyone tell me if there is a way to trace the whole http header that is being sent on myLoadVars.send?

I'm simply sending the contents of 8 textfields out to an asp script...except it's not working!

------------------------------------------------------

on (press) {
header = new LoadVars();
headerstr="lable1="+_root.firstname+
"&lable2="+_root.lastname+
"&lable3="+_root.address1+
"&lable4="+_root.address2+
"&lable5="+_root.address3+
"&lable6="+_root.postcode+
"&lable7="+_root.emailad+
"&label8="+_root.age;

header = headerstr;
header.send("http://www.nslaved.com/contact.asp" ,POST);
}
on (release) {
gotoAndStop(2);
}

----------------------------

Any help would be great!!!!!!!!!!!!

View Replies !    View Related
LoadVars.send Enigma
Hello,

Has anyone got any ideas re this...

I can't get the LoadVarsObject.send method to call an asp script without the browser leaving the movie and hanging up on a blank page.

It HAS sent the variables but it's waiting to download nothing!

I thought that by omitting the second parameter (i.e.,target) then the server's response would be discarded - y'know...like it says in the 'HELP" files (?!?)

I'm tearing my hair here

yours with lovely bloodshot eyes,,

Scott

//code//

on (press) {
header = new LoadVars();
header.lable1 = textfields.firstname;
header.lable2 = textfields.lastname;
header.lable3 = textfields.address1;
header.lable4 = textfields.address2;
header.lable5 = textfields.address3;
header.lable6 = textfields.postcode;
header.lable7 = textfields.emailad;
header.lable8 = textfields.age;
}
on (release) {
headerstr = "http://www.nslaved.com/contact.asp";
header.send(headerstr,"","GET");
header.onLoad = function(success) {
if (success) {
output = header;
}
};
}

View Replies !    View Related
Problems With LoadVars.send()
Hi I'm using the following script in my *.fla file
on (press){
_root.objLoad = new LoadVars();
_root.objLoad.FirstName = "name1";
_root.objLoad.LastName = "name2";
_root.objLoad.send("URL/login.asp");
}

and the following code in my *.asp file

<%
Dim fName
Dim lName
Dim DB
Set lName = Request("LastName")
Set fName = Request("FirstName")
Set DB = Server.CreateObject ("ADODB.Connection")
DB.Mode = adModeReadWrite
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +"D:InetpubwwwrootStudents.mdb")
Dim RS
Set RS = Server.CreateObject ("ADODB.Recordset")
RS.Open "Students", DB, adOpenKeyset, adLockOptimistic
RS.AddNew
RS("FirstName") = fName
RS("LastName") = lName
RS.Update
%>

When I use the *.asp code with HTML form it works fine but when I use it with Flash it doesn't.Also when I use load instead of send the script writes blank line in my DataBase.
Can anyone tell me what's wrong
p.s. When I use the GET method it works too. So can anyone tell me how to use the POST metod with flash ???

View Replies !    View Related
Trouble With LoadVars.send
I'm having a little trouble with basic LoadVars.send in MX.

I'm just sending a variable to a database.

If I open a new window:

saveLoadVars.send("update.cfm","_blank","post")

everything works fine but I'd prefer not to open a window, I'd prefer to send my variables to a page that doesn't appear onscreen and allow my flash app to just keep running).

But if I just send the variables without specifying anything else:

saveLoadVars.send("update.cfm")

It doesn't write to the database (I have a second window open where I can monitor this).

I know this is a really basic thing to do, and I can't figure out what I'm doing wrong.

Any help would be appreciated.

View Replies !    View Related
LoadVars.send() Not Working
i have been able to get this to work using the geturl() but not with the loadvars object. trace prints what i would expect to see.

here is the code in my flash button.

code:
on (release) {
submit = new LoadVars();
submit.returnAddress = txt1.text;
submit.messageBody = txt2.text;
if (submit.returnAddress.length && submit.returnAddress.indexOf("@") != -1 && submit.returnAddress.indexOf(".") != -1 && submit.messageBody.length) {
sumbit.send("http://www.webaddresshere.com/submit.php","_blank","POST");
trace(submit);
}
}


and my php


PHP Code:



<?php
$toAddress="john@someaddress.com";
$subject="Message From Website";
$returnAddress=$HTTP_POST_VARS[returnAddress];
$message=$HTTP_POST_VARS[messageBody];
mail($toAddress, $subject, $message, "From:$returnAddress
");
?>

View Replies !    View Related
[CS3] LoadVars.send Question
Hi, I have for the first time made a form in Flash! (shows what a nub I am I guess)

Got everything working with my cgi script nicely, but to make it better I would like to control the pop-up window size I have that displays the positive or negative response returned by the cgi script.

I have tried using the regular javascript code that you would use for the getURL method, but this seems to make my cgi script not work by possibly altering the formdata that is being sent.

here is the code I am using currently which just opens up a "_blank" window:


Code:
this.submit_btn.onRelease = function() {

var formdata:LoadVars = new LoadVars();
formdata.entryname = entryname_txt.text;
formdata.address = address_txt.text;
formdata.postcode = postcode_txt.text;
formdata.email = email_txt.text;
formdata.telno = telno_txt.text;
formdata.mobno = mobno_txt.text;
formdata.hearts = hearts_txt.text;

formdata.send("http://www.highchelmershopping.co.uk/valentinesurprise/valentineentry.cgi","_blank","POST");

};
and this is the code I tried to use to open a sized window with javascript


Code:
this.submit_btn.onRelease = function() {

var formdata:LoadVars = new LoadVars();
formdata.entryname = entryname_txt.text;
formdata.address = address_txt.text;
formdata.postcode = postcode_txt.text;
formdata.email = email_txt.text;
formdata.telno = telno_txt.text;
formdata.mobno = mobno_txt.text;
formdata.hearts = hearts_txt.text;

formdata.send("javascript:NewWindow=window.open('http://www.highchelmershopping.co.uk/valentinesurprise/valentineentry.cgi','newWin','width=300,height=250')","","POST");

};
I guess it could just be a syntax problem, but the response this gives me is that the new window opens at the correct size, however the cgi script always returns a negative response (i.e. a response that it gives when not all fields have been completed correctly) even when the form has been correctly completed and the same data returns a correct response with the _blank method.

While I wait for someone to respond to this I will see if I can work out how to alter my cgi script to return a the boolean values for using LoadVars.sendAndLoad instead, as I guess that would be a more elegant solution should I be able to get that to work.

View Replies !    View Related
LoadVars.send()—with No URL-8 Encoding
I am sending a form via LoadVars.send I have three variables that I am sending here is my code:


Code:
awardData.EDIT_AWARD = "http://www.editAwardSite.com";
awardData.ON_COMPLETION = ON_COMPLETION_URL;
escape(awardData.EDIT_AWARD);
awardData.Award = productNumber;

awardData.send(submitURL, "_blank", "GET");

The code is then sent to the appropriate URL, but it URL-8 encodes it. When the server receives the information it chokes on the passed info. It doesn't like having the underscore in the variable changed to %5F and the string within the variable (which happens to be a URL) changed to URL-8.

I have attempted to escape the string, but it doesn't work.

Is there a way to tell the LoadVars.send object NOT to use URL-8 encoding?

View Replies !    View Related
LoadVars Send To FormMail
I am trying to send a simple for to email using the FormMail program. However, the LoadVars object is converting the recipient email address to encoded characters (ie. myFUD%40octanner%2Ecom). I cannot find a setting in Flash nor method in the LoadVars object to not change the characters so that it does not encode those characters. Everything else is working. If I manually change the URL in the address bar and replace the encoded characters with the appropriate characters (@, ., etc), it works fine. I am stumped. How do I make it work?

View Replies !    View Related
LoadVars.send To A PopUp
Hi Folks,
I have an "Add to Cart" button in my Flash application and right now I have it running a LoadVars.send in an ActionScript to send the variables to a PHP file for further processing. Everything seems to be working but I'm trying to get the PHP file to load in a small HTML popup window (it's just a confirmation window). Does anyone know how to do that? My code looks something like this:


Code:
on (release) {
var my_lv:LoadVars = new LoadVars();

my_lv.BoxColor = boxColor;
my_lv.Font = fontVar;
my_lv.Text = typingtxt.text;
my_lv.ProductID = "bar-"+styleVar;
my_lv.send('confirm.php',"_self", "POST")

}
I tried to do something like this but it didn't work, obviously


Code:
my_lv.send(window.open('http://www.carvedsolutions.com/flash/confirm.php','_blank','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=100,height=100,left = 462,top = 334'), "_new", "POST")

Please don't flame me. I'm a PHP programmer trying to work with someone else's Flash/ActionScript application. Thanks!

Warm regards,
James

View Replies !    View Related
Weird Loadvars Send
i has one TEXT INPUT with variable "sendsend".

if i input the string like "test 1 2 3"

with this code:

Code:

_root.button.onRelease = function(){
var c = new LoadVars();
c.varsend = sendsend;
c.send("flash.php","_self","POST");
}

i get all this text in flash.php when i make this echo $_POST['varsend']:


Code:

<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="verdana" SIZE="10" COLOR="#FF0000" LETTERSPACING="0" KERNING="0">test 1 2 3</FONT></P></TEXTFORMAT>


why?

View Replies !    View Related
LoadVars.send() Not Working
here my code

var sendData:LoadVars = new LoadVars();
sendData["dataID"] = "MyDataID";
sendData.send("http://www.mydomain.com/submit.php", "_self", "POST");

when i'm running the swf and the php on same server, everythings ok.
once i'm moving the swf into another server with difference domain name

images.mydomain.com (where the swf locate)
www.mydomain.com (where the php page locate)

i call the LoadVars.send() with provide it absolute path to www.mydomain.com,
but there nothing happen when i press the button.

but it work if i place my swf in www.mydomain.com

any idea?

thanks a lot

View Replies !    View Related
Can't Send An Email Using ASP And LoadVars()
Hello,

I am trying to send an email after user inputs there information in a flash form. Everything seems to work a fine and the email sends off but only if i have hardcoded an email address in the "mail.From" in asp. I need it to collect the email address from the flash form (which it is doing because in the body i use the email variable and it sends the data fine), but for some reason when i put the variable name in the "mail.From" it doesn't send the email. Here is the code I am currently using:

////////////ASP

<%@language="VBSCRIPT"%>
<%
firstName = Request("fname")
lastName = Request("lname")
email = Request("email")
events = Request("events")
guests = Request("guests")

body = firstname & " " & lastname & " would like to be on the guestlist for "& events & " for " & guests & " people, email: " & email

Response.write(email)
Response.write(firstName)
Response.write(lastName)

server.ScriptTimeout = 300

Set myMail=CreateObject("CDO.Message")
myMail.Subject="sent from flash form"
myMail.From="admin@hotmail.com"
myMail.To="sogood@hotmail.com"
myMail.TextBody=body
myMail.Send
set myMail=nothing

Server.ScriptTimeout = 90

%>

///FLASH ACTIONSCRIPT

function sendForm() {
form = new LoadVars();
form.fname = fname.text;
form.lname = lname.text;
form.email = email.text;
form.events = event_input.getValue();
form.guests = guest_input.getValue();
form.sendAndLoad("contact/guestlist.asp" ,form, "POST");
_parent.gotoAndPlay("thank");
}

View Replies !    View Related
LoadVars.send() Asynchronous?
Does anybody know if LoadVars.send() is asynchronous? I can't find it documented anywhere. sendAndLoad() is asynchronous, but that's (at least) because it has a load() method in there. I assume that send() is asynchronous, but it returns a 'success' value. At first glance, I'd assume it couldn't return a success value if it were asynchronous, but at second glance it might be that the success value is simply whether or not the variables were sent or not. Anybody know if send() is asynchronous?

If it is asynchronous, I guess I'd have to use sendAndLoad() in order to find out when the variables went through.

View Replies !    View Related
Using LoadVars To Send Data?
I have some data which I am gathering throughout a program into an object that I want to send to an ASP page. I've heard that I can use a LoadVars object to send the data, but I've only used it to load data from another file. Do I have to separate out all the different data in the object into a query string before using the LoadVars object, or can the LoadVars object split everything out into the name-value pairs on its own?


Chris

View Replies !    View Related
LoadVars.send() Not Working
here my code

var sendData:LoadVars = new LoadVars();
sendData["dataID"] = "MyDataID";
sendData.send("

View Replies !    View Related
Flash To PHP Using LoadVars.send
For the life of me, I've tried everything:
I've researched LoadVars on Adobe forum, used David Powers' books, googled 'flash to php', LoadVars, etc. and tried sendAndLoad, send, and using $_POST, $_GET, $_REQUEST. $HTTP_POSTVARS but I keep getting this same error. any advice please?

I have a Unix server running Apache/PHP 4 - LoadVars worked to load name-value pairs into an array -see thread)

My goal with this simple app is to prototype being able to pass a variable from flash to a variable in php.

Parse error: syntax error, unexpected T_VARIABLE in flash_to_SQL.php on line 5

Actionscript 2.0 code:

var c :LoadVars = new LoadVars();
c.testing = "123FOUR";
c.send ("

View Replies !    View Related
LoadVars Send Problem
I am struggling with what appears to be the simplest thing.

Please tell me why my highscores.php file doesn’t open with “?playerscore=5413&playername=Rowan” after it.
When tested in a browser or on my local server, it outputs like this: “http://localhost/GameTest/highscores.php”

When tested from Flash (ctrl+Enter), it works perfectly. My browser opens and displays: “///D:/Work/GameTest/highscores.php?playerscore=5413&playername=Rowan” in the address bar.

What am I missing here? I used Dreamweaver to create the HTML file.

(Please download sample files here )
I am using CS3 but file must be published as v6.





























Edited: 03/25/2008 at 03:25:24 AM by rwittels

View Replies !    View Related
Trouble With LoadVars.send
I'm having a little trouble with basic LoadVars.send in MX.

I'm just sending a variable to a database.

If I open a new window:

saveLoadVars.send("update.cfm","_blank","post")

everything works fine but I'd prefer not to open a window, I'd prefer to send my variables to a page that doesn't appear onscreen and allow my flash app to just keep running).

But if I just send the variables without specifying anything else:

saveLoadVars.send("update.cfm")

It doesn't write to the database (I have a second window open where I can monitor this).

I know this is a really basic thing to do, and I can't figure out what I'm doing wrong.

Any help would be appreciated.

View Replies !    View Related
LoadVars.send Question
Hi Kirupans,
I'm trying to use the send method of a LoadVars object to track statistics via a PHP script, but I have a small problem. Everything works fine when I specify a target in the send method, i.e.:

statsVars.send("write_stat.php", "_blank");

But nothing happens when I don't specify a target window. Now obviously I need the statistics tracking to be invisible, so I can't have another window opening up or the window changing to a php page. So is this possible? My understanding from the documentation is that the send method should work regardless.
If you have any information about this, please let me know! Thanks so much!

View Replies !    View Related
Trouble With LoadVars.send
I'm having a little trouble with basic LoadVars.send in MX.

I'm just sending a variable to a database.

If I open a new window:

saveLoadVars.send("update.cfm","_blank","post")

everything works fine but I'd prefer not to open a window, I'd prefer to send my variables to a page that doesn't appear onscreen and allow my flash app to just keep running).

But if I just send the variables without specifying anything else:

saveLoadVars.send("update.cfm")

It doesn't write to the database (I have a second window open where I can monitor this).

I know this is a really basic thing to do, and I can't figure out what I'm doing wrong.

Any help would be appreciated.

View Replies !    View Related
LoadVars & Send Question
Good day.

I'm trying to pass a few variables from Flash combo box components to an existing URL from elsewhere. I was able to pass the variables fine when there were matching boxes with same instance names, but in this particular case I have to include the variables from Flash inside the search thread of the URL. Here's an example.

I have 3 combo boxes, theDay, theMonth, and theYear. Let's say the existing URL search thread is supposed to be:

http://yourdomain/foldername/0,11111,27-3-6,00.html

where 27-3-6 part is supposed to be the day, the month, and the year.

In JavaScript, a function is setup to read the variables from HTML's combo boxes and plug into a JavaScript funtion in such ways:

window.open("http://yourdomain/foldername/0,11111," + theDay + "-" + theMonth + "-" + theYear + ",00.html" + "");


How would I do this?
Anyone???

View Replies !    View Related
New Window Opening With LoadVars.send
Hi.

here's what's happening:

myVars.send("myfile.asp") does not work.

however,

myVars.send("myfile.asp","","POST") does work

but it opens myfile.asp in a new window.

Here is another quirk. If you submit this data 5 times, it opens 5 myfile.asp browser windows. but only the first 4 register in the database.

if you send this 7 times you get 7 open windows and only the first 6 register in the database.

etc. where the last (or most recent) request is not sending from myfile.asp to the database.

any ideas would be very helpful.

Thanks.

View Replies !    View Related
LoadVars() Help, Send And Receive Texts...
Hello, I have a problem with an example I am doing. I want to have a person put in their name in the text field named:"send_text1". And then I want them to push the button, and onPress, I want it to send the information to an external PHP file and then onRelease, i would like the information to be loaded...I keep getting:"_level0.rec_text1" for the receiving text area, and then i get:"_level0.send_text1" for the sending text. Here is a file I uploaded to maybe help you guys. Please help me!?!?

View Replies !    View Related
[F8] Using LoadVars To Send Data To MySQL
Can anyone guide me through sending data to a mySQL database?

Basically a user inputs some text into an input field and the text is placed into an existing mySQL database.

Here is the AS Code on the button:

Code:
on (release) {
var regVars:LoadVars = new LoadVars();
regVars.action = 'store';
regVars.productdoes = tWhatDoesItDo.text;
regVars.sendAndLoad("http://localhost/project/version%204/store.php", regVars, "POST");
btnSubmitForm.enabled = false;
regVars.onLoad = function() {
tWhatDoesItDo.text = "success";
};
}
and the PHP code:

PHP Code:



<?php

   $host = 'localhost';
   $dbuser = 'root';
   $dbpass = 'dbpassword';
   $dbname = 'dbname';
   $table = 'dbtable';
   $db = @mysql_connect($host,$dbuser,$dbpass) or die("error=could not connect to $host");
   $db = mysql_select_db($dbname);
   if(!$db)
   {
      print "error=could not connect to $dbname table";
      exit;
   }
   
// ---
// storing details
// ---
function store($productdoes)
{
   $db, $table;
   $productdoes = trim($productdoes);
   $query = @mysql_query("INSERT INTO $table (productDoes) VALUES "
   ."('$productdoes')");

}
?>




There's definately a problem, as nothing is placed into the database.

View Replies !    View Related
Not Authorized Error Using LoadVars.send
I'm using LoadVars.send( "xxx.php", "_parent", "POST" ) in a .swf file to post data to a .php file located on the same directory. It works fine on a web server located in my office's LAN. However, after I copy the same files to a remote server, it fails with an error like this:

Not authorized to view this page (blah blah blah)
HTTP Error 403 (Forbidden)

What could be the reason?
Thanks for help!

View Replies !    View Related
Using LoadVars To Send UTF-8 Formatted Text
In my application I recieve xml encoded as UTF-8. In my case this xml contains Polish chars/words like "części". The users of the application can now edit the text and on save I send it back to the server...

To send the data back I create a xml string and send it like this:
var loadUrl = GlobalSetting.get("servletIP") + Servlets.get(servletname);
var send_lv:LoadVars = parameters;
send_lv.sendAndLoad(loadUrl, this, "POST");

where parameters is a LoadVars looking kinda like this:
var parameters = new LoadVars();
parameters.action = add;
parameters.id = someId;
parameters.xml = theXmlString;

The Problem:
Using LoadVars will URLEncodes all the parameters, in the case of the Polish characters the ę is encoded to %C4%99 . The Java.URLEncoder does not understand the %C4%99 encoding and wrong data is saved...

Does anyone know how I can avoid this problem???
I want to send the actual ę character, and it should be possible because I should send it as a UTF-8...

View Replies !    View Related
LoadVars.send And SendAndLoad Problems With Php
Hi

My flash program needs to send some variable to a php file which uses it to output an xml file. I'm using LoadVars.send but i'd like to use loadVars.sendAndLoad as i really dont want the browser window to open at all as i need these things to happen in the background. The php file creates an xml and then lauches an exe which uses the xml. I'm having a couple of problems,
1. when i use send the swf seems to have to be on a different machine to the php and where the xml is created or for some reason the php doesnt receive the variables,
2. i have to use $GET in the php and not $POST - not a major problem but i'd like to know why
3. sendAndLoad just doesnt work at all.

the code is as follows

thanks Greg







Attach Code

/*ActionScript Class to send variables to php*/

class phpWriter{
var myPHP:XML;
var sendPHP:LoadVars;
var server = "http://mrServer/myfolder/";


function phpWriter(){
}

function loadPhpData():Void
{
myPHP = new XML();
sendPHP = new LoadVars();
sendPHP.contentType = "text/xml";
//sendPHP.contentType = "application/x-www-form-encoded";
myPHP.ignoreWhite = true;
//trace("user = " + _root.userId);
sendPHP.userid = _root.userId;
sendPHP.boxX1 = _root.boxX1;
sendPHP.boxY1 = _root.boxY1;
sendPHP.boxX2 = _root.boxX2;
sendPHP.boxY2 = _root.boxY2;
sendPHP.leftEyeX = _root.leftEyeX;
sendPHP.leftEyeY = _root.leftEyeY;
sendPHP.rightEyeX = _root.rightEyeX;
sendPHP.rightEyeY = _root.rightEyeY;
sendPHP.leftMouthX = _root.leftMouthX;
sendPHP.leftMouthY = _root.leftMouthY;
sendPHP.centreMouthX = _root.centreMouthX;
sendPHP.centreMouthY = _root.centreMouthY;
sendPHP.rightMouthX = _root.rightMouthX;
sendPHP.rightMouthY = _root.rightMouthY;
sendPHP.chinX = _root.chinX;
sendPHP.chinY = _root.chinY;
trace("sent");

//sendPHP.sendAndLoad(server + "XMLWriter.php",myPHP,"POST");
sendPHP.send(server + "XMLWriter.php","_blank","POST");

myPHP.onLoad = function(success:Boolean):Void
{
//attempt to load strings, otherwise error string
if(success)
{
_root.ClearError();
trace("loaded");
}
else
{//initial set variables using outside text files
_root.SetError();
trace('The speech information file could not be read');
}
}
}

}


/*php code to receive variables, create xml and run .exe*/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>

</head>
<body>
<?php
/*have to use $GET as $POST doesnt work*/
$userid = $_GET["userid"];
$boxX1 = $_GET["boxX1"];
$boxY1 = $_GET["boxY1"];
$boxX2 = $_GET["boxX2"];
$boxY2 = $_GET["boxY2"];
$leftEyeX = $_GET["leftEyeX"];
$leftEyeY = $_GET["leftEyeY"];
$rightEyeX = $_GET["rightEyeX"];
$rightEyeY = $_GET["rightEyeY"];
$leftMouthX = $_GET["leftMouthX"];
$leftMouthY = $_GET["leftMouthY"];
$centreMouthX = $_GET["centreMouthX"];
$centreMouthY = $_GET["centreMouthY"];
$rightMouthX = $_GET["rightMouthX"];
$rightMouthY = $_GET["rightMouthY"];
$chinX = $_GET["chinX"];
$chinY = $_GET["chinY"];

// Open the file and erase the contents if any
$fpa = fopen("$userid.xml", "w+");

// Write the data to the file
fwrite($fpa,"<?xml version="1.0" encoding="ISO-8859-1" ?>
<character>");
fwrite($fpa, "
<image>$userid.jpg</image>");
fwrite($fpa, "
<box>");
fwrite($fpa, "
<point name="x1">$boxX1</point>
<point name="y1">$boxY1</point>
<point name="x2">$boxX2</point>
<point name="y2">$boxY2</point>");
fwrite($fpa, "
</box>");
fwrite($fpa, "
<markers>");
fwrite($fpa, "
<point name="leftEyeX">$leftEyeX</point>
<point name="leftEyeY">$leftEyeY</point>");
fwrite($fpa, "
<point name="rightEyeX">$rightEyeX</point>
<point name="rightEyeY">$rightEyeY</point>");
fwrite($fpa, "
<point name="leftMouthX">$leftMouthX</point>
<point name="leftMouthY">$leftMouthY</point>");
fwrite($fpa, "
<point name="centreMouthX">$centreMouthX</point>
<point name="centreMouthY">$centreMouthY</point>");
fwrite($fpa, "
<point name="rightMouthX">$rightMouthX</point>
<point name="rightMouthY">$rightMouthY</point>");
fwrite($fpa, "
<point name="chinX">$chinX</point>
<point name="chinY">$chinY</point>");
fwrite($fpa, "
</markers>");
fwrite($fpa,"
<glasses>0</glasses>");
fwrite($fpa,"
</character>");

fclose($fpa);

$a = "my.exe "$userid" "false"";
exec("$a");
?>
</body>
</html>

View Replies !    View Related
Problems With LoadVars.send And Firefox
There seems to be a problem with Firefox 2.x sending variables to PHP scripts with the LoadVars.send/POST method. <br>
The same problem doesn't occur in IE or Opera.
<br>See this url for example to try in both FF and IE/Opera: here.
<br>The source files are here
Any ideas?
g.zelenka@iinet.net.au

View Replies !    View Related
Using LoadVars To Send Data By POST
Hi all,

For some frustrating reasons, Flash MX is refusing to send data to my PHP page using the POST method. Here's the code I use:


Code:
dataLoader.send("http://localhost/coe/register.php", "_self", "POST");
However, it always got send as a GET. I have no idea why, and the strangest thing of all is that sendng by POST was working only a couple of days ago! I didnt touch the Flash file save for the PHP script.

Any ideas?

View Replies !    View Related
How Much Data Can Be Send To External Php Using Loadvars
Hi All

I want to know dat how much data can be send to external php or asp file using loadvas... I am sending about 25 variables but all off them are not coming to my php page.

Plz suggest me what to do?

Thanks

View Replies !    View Related
Flash LoadVars.send NOT Working.
Here is my Flash Action Script:


on (release) {
myVars = new LoadVars();
myVars.val = sector_01_var;
myVars.col = sector_01_status;
//myVars.SendAndLoad("http://www.jrphosting.co.uk/wellq/wellq_write_record.php", myVars, "POST");
myVars.SendAndLoad("http://www.jrphosting.co.uk/wellq/wellq_write_record.php", "_out", "POST");
gotoAndStop(25);
}


Here is my PHP script:


<?php
include("db.inc");

$conn=@mysql_connect("$db_address", "$db_username", "$db_password") or DIE("Could not connect to MySQL.");
$rs = @mysql_select_db("$db_name",$conn) or DIE("Could not select database.");
$sql = "INSERT INTO $db_table (wqr_sector_01_v, wqr_sector_01_c, wqr_uid) VALUES ('$var', '$col', '00000007')";
$rs = @mysql_query($sql,$conn) or DIE("could not execute query - get package details.");

mysql_close($conn);
?>


Problem:

The PHP script works if you send it with data, such as:
http://www.jrphosting.co.uk/wellq/we...hp?var=3&col=R
...it appears in the database fine...
http://www.jrphosting.co.uk/wellq/wellq_read_record.php

BUT Flash will not do it?
http://www.jrphosting.co.uk/wellq/

I'm stumped, help!

View Replies !    View Related
Flash LoadVars.send Method
I'm sending three variables from Flash to a database using the LoadVars.send method. My code to send the variables is:

coordinates.send("coordinates.asp", "post");

Even though there is no '_target' it still opens the results in a new window.

Is there any way to stop it from doing this?

View Replies !    View Related
LoadVars.send Doesn't Want To Use POST
Subject says it all... I have a loadvars object, that should send some vars to a a PHP script via POST, but even when specified that it should use post, it uses get.... Why?

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved