-
IT'S GON' RAIN !!!
need help with loadVars
hey,
ive got a project where i have to load 2 variables into a php script, ive tried a few ways but none seem to work.
what i need to do is basically call this address:
http://www.mysite.com/script.php?db=100&at=q76
but the 'db' and 'at' variables are what i need to load.
i have tried this:
Code:
var siteUrl = "http://www.mysite.com/";
var db = db.text;
var at = "q76";
submit.onPress = function() {
myData = new LoadVars();
myData.load(siteUrl+"script.php?db="+db.text+"&at="+at, "POST");
myData.onLoad = function(success) {
if (success) {
smessage.text = "Ok";
} else {
smessage.text = "Nope";
}
}
}
so i need it to load the 2 variables and execute the script.
i have probably done this wrong, i hate loadvars, and im sure it hates me.
any help would be great.
thanks.
-
Working from memory here - but doesn't LoadVars post all variables that are in the LoadVars object?
Try putting this just below "myData = new LoadVars()":
myData.db= db.text;
myData.at = at.text;
and see if it works.
-
IT'S GON' RAIN !!!
No, that doesnt work, all i need it to do is load this url http://www.mysite.com/script.php?db=100&at=q76 without actually opening a page.
-
FK'n_dog
Code:
myData = new LoadVars();
myData.db= db.text;
myData.at = "q76";
myData.onLoad = function(){
trace(unescape(this));
};
path = siteUrl+"script.php";
myData.sendAndLoad(path,myData,"POST");
hth
-
IT'S GON' RAIN !!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|