473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Flash send value to database with PHP

11
Hi!

I know a solution for this problem and that is using this code:

PHP: (submitScore.php)
<CODE>
<?php
$nick = $_POST['Nick'];
$score = $_POST['Score'];
$kills = $_POST['Kills'];
$floor = $_POST['FloorNr'];

$db=mysql_connect("")
or die("Couldn't connect.");
mysql_select_db("databasename", $db);

mysql_query("INSERT INTO Table (Nickname,Score,Kills,Floor) VALUES ('$nick','$score','$kills','$floor')",$db);

mysql_close($db);
echo "Your score has been submited! ";
?>
</CODE>

Actionscript:
<CODE>
myData = new LoadVars();
myData.Nick = nickname.text;
myData.Score = _global.score;
myData.Kills = _global.TotalKills;
myData.FloorNr = _global.floorNr;

myData.send("submitScore.php", myData, "POST");
</CODE>

The problem with this is that submitScore.php pops up in the browser so that
the player can just refresh the submitScore.php page and in such a way
repeat the insert query to the database, adding the score several times.
Either I can make the page close down on its own or is there a way to insert a
value to a database without making the submitScore.php pup up and accessible
to the user?
Jun 4 '07 #1
1 6917
kestrel
1,071 Expert 1GB
You can go ahead and post this into the php forum as well, you might be able to find an answer there.
Jun 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jason | last post by:
this is my code and what i get... i'm accessing this through this url http://192.168.0.2/php/test2/test.php?user=me@test.ca&subject=test it grabs the correct stuff from the database, but...
10
by: Steve Cook | last post by:
Hi, I have an upload application written in PHP and Flash. The PHP page gets the file information via $_POST. Moreover, the user never actually visits the PHP page, rather Flash sends the...
2
by: avanhalen | last post by:
To embed flash objects in my pages, I read them from a database. A script file (Filedownload.aspx) reads it from the database, and streams it to the browser. Here are two example flash objects...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
2
by: molle | last post by:
Hi! This has been posted in the flash-forum as well. I know a solution for this problem and that is using this code: PHP: (submitScore.php) <?php $nick = $_POST;
0
by: Shaikh shahnawaz | last post by:
Hi, I have implement multiple file uploading progress bar with the help of flash and .net file is upload on my local machine but not working with server it's give error while uploading image on...
4
by: benjaminkang | last post by:
I'm very new to Coldfusion and action script, but due to job requirements, i got allocated the task of developing a cfm page where the user logs in using the embedded swf file and everything was...
0
by: benjaminkang | last post by:
I'm very new to Coldfusion and action script, but due to job requirements, i got allocated the task of developing a cfm page where the user logs in using the embedded swf file and everything was...
2
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.