PDA

View Full Version : How to get user input from actionscript to php?


rocky86
08-06-2007, 03:13 AM
Hi I am new here I wanted to know how to get an user input textbox to be send to php? I try alot of method both GET and POST it does not seen to work plss help me!!

My actionscript code:

postalOut.postal=assign.postal.text;
var postalOut:LoadVars = new LoadVars();
postalOut.sendAndLoad(passingurl, postalIn, "POST");



My PHP code:

$postalno=$_POST['postal'];

$resultpostal=mysql_query("SELECT location.uname,location.uid FROM location,districts WHERE districts.districtno ='$postalno' AND
location.lat BETWEEN districts.startlat AND districts.endlat AND location.lng BETWEEN districts.startlng AND districts.endlng");



Then I need to put in the value in my SQL to compare it is my code wrong?

StupidRalph
08-08-2007, 01:52 PM
Hey Rocky welcome to CodingForums.

Here is how I'm using mine:

var send_lv:LoadVars = new LoadVars(); //init send_lv as LoadVars
//Here you insert variables to be sent
send_lv.rating = this.rate_value;
send_lv.memberID = memberID; //variable set via SWFObject
send_lv.songID = songID; // variable set via SWFObject
send_lv.sendAndLoad("http://www.8thwondercdpool.com/v2/rate_flash.php", send_lv, "POST");



Perhaps all you simply need is to initialize your Load Variable before you try to assign a value to .postal like this

var postalOut:LoadVars = new LoadVars(); //initialize the variable first
postalOut.postal=assign.postal.text;
postalOut.sendAndLoad(passingurl, postalIn, "POST");


UNRELATED: Could I bother you to check out my post here (http://www.codingforums.com/showthread.php?t=120844) and provide feedback to help me determine if this is an IE bug or not.
http://www.codingforums.com/showthread.php?t=120844