PDA

View Full Version : Error or me dumb?



Nikini
June 25th, 2007, 08:11 AM
check this script out

function form_submit(event:MouseEvent) {
stat.text="Trimitere in curs...";
//we get the values
var nume:String = form.inume.text;
var email:String = form.iemail.text;
var mesaj:String = form.imesaj.text;
var fid:String = MovieClip(root).parameters.curID;
//we create the objects
var loader:URLLoader=new URLLoader;
var req:URLRequest=new URLRequest('send.php');
var vars:URLVariables=new URLVariables;
req.method=URLRequestMethod.POST;
req.data=vars;
vars.fid=escape(fid);
vars.nume=escape(nume);
vars.email=escape(email);
vars.mesaj=escape(mesaj);
//we send the request
loader.load(req);
//when it's done
loader.addEventListener(Event.COMPLETE,getRes);
}
trim.addEventListener(MouseEvent.CLICK,form_submit );
function getRes(event:Event):void {
stat.text="Mesaj trimis";
form.inume.text="";
form.iemail.text="";
form.imesaj.text="";
}
i send 4 variables via post to a php file. but it does not work. it does not even send something to php. it does not even connect to the php page. if i remove a variable, it works fine, but if there are 4 it does not work.. why?? flash player error? or me??? really need help on this one..

Dazzer
June 25th, 2007, 08:19 AM
try

vars.fid=escape(fid);
vars.nume=escape(nume);
vars.email=escape(email);
vars.mesaj=escape(mesaj);
req.data=vars;

Nikini
June 25th, 2007, 08:29 AM
still not working.. :(

Dazzer
June 25th, 2007, 08:30 AM
then I'm stumped . Sorry!

Nikini
June 25th, 2007, 08:31 AM
Thanks adobe once again for making flash so god damn dumb.. my boss is gonna kill me.. thanks anyway

Dazzer
June 25th, 2007, 08:32 AM
Question!
I know it seems stupid but...

are you testing locally? or on server?

.php server scripts only work on a server...

Nikini
June 25th, 2007, 08:34 AM
of course on a server.. if i said it works for 3 variables.. and for 2...

Nikini
June 25th, 2007, 08:40 AM
i answered my question. it is "me dumb" it appears my php file had an "." (full stop) somewhere which was activated only when the 4 variales were sent and the script failed. nasty! spent 3 hours for that..:D i'm such a noob sometimes

Dazzer
June 25th, 2007, 08:52 AM
glad it works :)

lightscience
June 26th, 2007, 02:49 AM
yeah i'm glad it works, because that would be horrible if your boss actually KILLED you!!!

NaughtyPine
June 26th, 2007, 04:44 PM
Stupid stuff gets me all the time, dum dum dum. :bucktooth:

Dazzer
June 26th, 2007, 10:23 PM
Read my thread on Loader Bug...

- hides embarassed -