Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : Hidden vars in url...



kafir
5/26/2004 9:15:43 PM
I'm sending information from my flash to a php file. Is there anyway that i can
avoid the vars being displayed in the url?

This is my code so far. I works great but i need it to hide the vars because
i'm sending alot of information.

var args;

args = "newSearch = 1";
args+="&searchType = 1";
args+="&searchArea = 0";

args+= "&continent = $europe";
args+="&country = $denmark";

args+="&fromYear = $";
args+="&fromMonth = $";
args+="&fromDay = $";

args+="&toYear = $";
args+="&toMonth = $";
args+="&toDay = $";

// notice the question mark!
myURL = "../search/searchResults.php?" + args;
getURL(myURL, "_parent", "POST");

stop()
Jack.
5/26/2004 9:38:05 PM
have you tried LoadVars.sendAndLoad

sendV =new LoadVars();
sendV.newSearch = 1;
sendV.searchType = 1;
sendV.searchArea = 0;
// and so on

recV = new LoadVars();
recV.onLoad = function(){
trace(unescape(recV));
};
sendV.sendAndLoad(myURL,recV,"POST");

hth ?
kafir
5/27/2004 12:40:25 PM
The thing is that it needs to open another page - the search.php page - and
show the resultet. The result should not be return to flash. It should just be
send to php from where php will handle the vars and show the search result.

Can i still use your example to the action mentioned above?

/Mikae
Fred Reis
5/27/2004 12:57:41 PM
Hi,

You've to use getURL with POST value in the last parameter. Like this:

this.createEmptyMovieClip("myForm", 0);
myForm.newSearch = 1;
myForm.searchType = 1;
myForm.getURL("../search/searchResults.php", "_blank", "POST");
kafir
6/7/2004 9:59:44 PM
Thanks so far. I'm trying to pass the variables for continent and country

myForm.continent = $continent;
myForm.country = $country;

But if i example use: myForm.continent = $Europa;
myForm.continent = "$Europa";

My php fil will not solve this. I need to get infomationen from my database
through a php fil.

Hope you have som clues

/Kafir
AddThis Social Bookmark Button