Flash

Hey,

also ich brauch Hilfe zu Flash.

Ich versuche die Daten von dem Votesystem aus der PHP Datei zu laden.

AS2:

[code]stop();
//How many votes in total?
var totalVotes:Number = loadVars_in.totalVotes;
var end:String
for(i=1;i<=4;i++){
vote = loadVars_in[“vote” + i + “total”]
procent = Math.round(( vote / totalVotes) * 100);
if(votes==1){
end = “Vote”;
} else {
end = “Votes”;
}
_root[“graph”+i+"_mc"].bar_mc._xscale = procent;
_root[“graph”+i+"_mc"].procent.text = procent + " % - " + vote + end;

}[/code]

und die PHP Datei:

<? //User, password & database $choice =$_POST['choice']; $user="USER"; $password="PASSWORT"; $database="DATAB"; mysql_connect(localhost,$user,$password); @mysql_select_db($database) or die( "Unable to connect to database"); // what choice did the user choose in flash? if($choice == 1){ $query="UPDATE votesystem SET vote1=vote1+1"; } if($choice == 2){ $query="UPDATE votesystem SET vote2=vote2+1"; } if($choice == 3){ $query="UPDATE votesystem SET vote3=vote3+1"; } if($choice == 4){ $query="UPDATE votesystem SET vote4=vote4+1"; } mysql_query($query); //Get values from the database $query="SELECT * FROM votesystem"; $result=mysql_query($query); mysql_close(); //What are the values from the database? $vote1_out=mysql_result($result,0,"vote1"); $vote2_out=mysql_result($result,0,"vote2"); $vote3_out=mysql_result($result,0,"vote3"); $vote4_out=mysql_result($result,0,"vote4"); //Votes in total $total=$vote1_out+$vote2_out+$vote3_out+$vote4_out; //Info to send back to flash: $values="&totalVotes=$total&vote1total=$vote1_out&vote2total=$vote2_out&vote3total=$vote3_out&vote4total=$vote4_out"; echo "$values"; ?>

irgendwie muss ja die PHP Datei noch in Flash intigriert werden…
und die PHP File dient auch für das Voten, damit es in die MySQL DB eingetragen wird.

Grüße

Wo ist den die IP Sperre geblieben??? o.0 :unamused:

ist jetzt in flash intigriert mit einem cookie, aber keinem normalen sondern einem flash cookie

ok… :susp: :unamused:
Ist dir überlassen

@JW Lightning:
Ich würde es auch nicht mit IPs machen…
Denn, wenn jemand nen Proxy hat, und blablabla, ich glaube diese Thema ist in diesem Forum sehr häufig…

obwohl alleine auf das Cookie würd ich mich auch nicht verlassen, aber wie es jw-light schon sagte, es ist dir überlassen

mfg Joey

les mal hier :p

viewtopic.php?f=10&t=7356&start=20
(ab 5 Post.)