Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-09-2011, 08:55 PM   #1
Xyphon
Registered User
 
Join Date: Jan 2008
Posts: 8
Default [AS2] High Score Submit Issue

On my game, I have a high score submit script. It is all done on a file on my website(So this is kind of a PHP + AS2 problem, but moreso AS2). When the game is hosted on my website, the high score submit works fine. But when it is hosted on any other website, it doesn't work. This is the AS2 code:
ActionScript Code:
on (release) { System.security.allowDomain("mywebsite"); lvOut = new LoadVars(); uscore = new LoadVars(); uscore.name = _root.suname; uscore.score = _root.suscore.stime; uscore.game = "alien"; uscore.mode = "survival"; uscore.password = "password"; _root.play(); uscore.onLoad = function(success) { if(success) { _root.play(); } else { _root.connecterror.play(); } } uscore.sendAndLoad("mywebsite/highscoresubmit.php",lvOut,"POST "); }
And this is the php for highscoresubmit.php:
PHP Code:
$game=$_POST['game'];
$name=$_POST['name'];
$mode=$_POST['mode'];
$score=$_POST['score'];
$password=$_POST['password'];
$game=mysql_real_escape_string($game);
$name=mysql_real_escape_string($name);
$mode=mysql_real_escape_string($mode);
$score=mysql_real_escape_string($score);
if(
$password=="password")
{
mysql_query("INSERT INTO scores(game, name, score, mode) VALUES('$game', '$name', '$score', '$mode')");
}
else
{
header('Location:notfound.php');

As I said, this works fine if the game is hosted on my wesbite, but doesn't when it is anywhere else. What do I need to change in the AS2 to fix this?

Thank you in advance,
Xyphon.
Xyphon is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:15 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.