Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: LoadVars help

(115 views • 5 replies)

This topic is 1 page long.

<< < > >>
None

Snubby

Reply To Post Reply & Quote

Posted at: 12/20/07 12:00 AM

Snubby FAB LEVEL 20

Sign-Up: 12/04/04

Posts: 3,123

For some reason when I do this it sends it using GET (the variables are visible in the address). Anybody know how I can send it using POST?

var highscoreObject:LoadVars = new LoadVars ();
highscoreObject.nameSend = "Name";
highscoreObject.scoreSend = 26;
highscoreObject.send ("http://www.snubbyland.com/highscores_theWorldsHardestGame.php", "_blank", "POST");

Happy

zenyara

Reply To Post Reply & Quote

Posted at: 12/20/07 12:28 AM

zenyara NEUTRAL LEVEL 10

Sign-Up: 06/17/05

Posts: 839

function updateToon() {
	//create a new LoadVars Object
	toonMe = new LoadVars();
	toonMe.toString();
	toonMe.onLoad = updateToonReply;
	randNo = getTimer();
	//Send the variables and wait for the response.
	toonMe.sendAndLoad("../update.php?random="+randNo+"&", toonMe, "GET");
}
function updateToonReply() {
	if (toonMe.CONFIRM == "done") {
		servermsg+= toonMe.SERVERMSG;
		servermsg.scroll += 4;
	}
}

I always use GET. works every time without fail. POST sucks...


None

Snubby

Reply To Post Reply & Quote

Posted at: 12/20/07 12:46 AM

Snubby FAB LEVEL 20

Sign-Up: 12/04/04

Posts: 3,123

At 12/20/07 12:28 AM, zenyara wrote: I always use GET. works every time without fail. POST sucks...

Then anybody can just type in &score=100 into the addres and they'll have gotten a score of 100. do you even know what get and post means?


None

authorblues

Reply To Post Reply & Quote

Posted at: 12/20/07 01:09 AM

authorblues FAB LEVEL 12

Sign-Up: 06/21/05

Posts: 6,263

At 12/20/07 12:28 AM, zenyara wrote: I always use GET. works every time without fail. POST sucks...

no, but seriously. do you even know what youre talking about?
_GET and _POST vars arent just names. they have actual, differentiable purposes.

At 12/20/07 12:46 AM, Snubby wrote: Then anybody can just type in &score=100 into the addres and they'll have gotten a score of 100. do you even know what get and post means?

before you play know-it-all, know that it takes VERY little work to fake _POST headers. the difference between sending _GET vars thru the url and faking _POST headers is negligable, and that should NOT be your motivation for using _POST.

my blog. smash code: 3523-1700-9216 [AUTHR]

BBS Signature

None

under-siege

Reply To Post Reply & Quote

Posted at: 12/20/07 04:32 AM

under-siege DARK LEVEL 03

Sign-Up: 05/11/07

Posts: 550

At 12/20/07 12:00 AM, Snubby wrote: For some reason when I do this it sends it using GET (the variables are visible in the address). Anybody know how I can send it using POST?

var highscoreObject:LoadVars = new LoadVars ();
highscoreObject.nameSend = "Name";
highscoreObject.scoreSend = 26;
highscoreObject.send ("http://www.snubbyland.com/highscores_t heWorldsHardestGame.php", "_blank", "POST");

You will need to change the send thing to sendandLoad and replace "_blank" with an loadVars instance to receive the returned data (if there is any). I think the problem is the "_blank" target thb (that will cause the request to be sent via the browser), but most scripts will send something back even if it just tells you if it was successful. If you want to show the high scores after the new score has been added, wait for the return stuffs and then just open the page using the normal getURL function.

I don't know how anybody can say that faking post headers is just as easy as typing in a url - that's just rubbish. Yes, it's not hard to fake post header, but the fact that the topic starter knew how to cheat via the url, but not post then that kinda proves the point. In fact ask anybody on this forum, the majority won't know how to fake post headers or don't have the software to do it - to cheat via the url just requires IE which is installed on nearly all windows machines.


None

Snubby

Reply To Post Reply & Quote

Posted at: 12/20/07 03:54 PM

Snubby FAB LEVEL 20

Sign-Up: 12/04/04

Posts: 3,123

At 12/20/07 01:09 AM, authorblues wrote: before you play know-it-all, know that it takes VERY little work to fake _POST headers. the difference between sending _GET vars thru the url and faking _POST headers is negligable, and that should NOT be your motivation for using _POST.

I know what post and get are bro i use them all the time, whether or not you can manipulate post you still wouldn't use get to send a highscore, you use post.

anyway i figured out the problem turns out theres a bug in the send method that makes it always send get when you test locally, says so in the comments for the method in livedocs. problem solved.


All times are Eastern Daylight Time (GMT -4) | Current Time: 11:16 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!