View Full Version : identifying their score...
SetroGamer
September 16th, 2003, 11:12 PM
For my game, I have the whole send score thing. I have the flash part include the php with the scripting on it for the send score, but I don't understand how to get it to identify what they score was(_root.score)...if I just enter any old score into the scripting it works, so I know its not how I scripted it. (I tried using $score, which is what my friend told me to do). Please help me!
SetroGamer
September 17th, 2003, 09:00 AM
Someone has to know...T_T
Jubba
September 17th, 2003, 09:36 AM
i don't understand. Show us your code and tell us in detail what is or isn't working...
Jack_Knife
September 18th, 2003, 06:04 AM
Do you mean that you can't get the PHP script to find the score value? If $score doesn't work, you may not be sending it properly in flash.
SetroGamer
September 19th, 2003, 08:09 PM
the php part:
<?php
//db connection is above this-not posted
$date=date(Ymd);
if($score=='') {
$score='0';
}
mysql_query("UPDATE users SET sc=sc+$score WHERE username='$username'") or die(mysql_error());
mysql_query("INSERT INTO scores VALUES('pong','$username','$score','$date')") or die(mysql_error());
?>
The flash part:
------
onClipEvent (load) {
loadVariables("http://setropets.com/worlds/GamiaIsland/gspong.php", this, "GET");
}
------
Jubba
September 19th, 2003, 08:12 PM
you have to output the values so that Flash can read it. Check out this page:
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=17604
SetroGamer
September 19th, 2003, 08:37 PM
It still doesn't work :( I have this:
----------
onClipEvent (load) {
getURL("http://setropets.com/worlds/GamiaIsland/gspong.php", _blank, "POST");
}
---------------
and the php:
<?php
require("header.php");
//db connection info taken off here
?>
<?php
$score=$_POST['score'];
if($score=='') {
$score="0";
}
$date=date(Ymd);
mysql_query("UPDATE users SET sc=sc+$score WHERE username='$username'") or die(mysql_error());
mysql_query("INSERT INTO scores VALUES('pong','$username','$score','$date')") or die(mysql_error());
echo "Your score of <b>$score</b> was sent!<br><a href=pong.php>Play Agian!</a>";
require("side2.php");
?>
Jubba
September 19th, 2003, 08:40 PM
what exactly are you trying to send back to the FLash file? Is it stuff from the database? or is it just the score?
oih wait... are you even trying to send stuff back to the flash file? I don't really understand what you are trying to accomplish... sorry. Just explain it really well and I'm sure I'll be able to help...
SetroGamer
September 19th, 2003, 08:46 PM
Okay, after they play their game they hit 'send score' and then I want it to load a PHP page that will send their score into the database and record it. The problem I've been having is that it doesn't know what your score was. I've been trying mulitple ways to do it but none work. everyone always tells me something different to try and now I'm confused @.@
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.