SitePoint Sponsor |
|
User Tag List
Results 1 to 16 of 16
Thread: Php and Action script
-
Jun 10, 2005, 19:36 #1
- Join Date
- Jun 2005
- Posts
- 10
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Php and Action script
var getCarListVars = new LoadVars();
getCarListVars.accountID = _root.accountID;
getCarListVars.sessionKey = _root.sessionKey;
getCarListVars.action = "getCarSearchList";
_root.getCarListLV = getCarListVars.toString();
_root.getCarListLVFlag = "0";
getURL("lingo: executeCall \"getCarListLV\"", "");
loadVariables("http://nittorevelation.com/reve10.php", "POST");
stop();
^^^^^
Thats my action script. I need a Php made to capture the incoming Variables that the game is sending. This line in the action script, loadVariable("http://nittorevelation.com/reve10.php", "POST"); will be sending it. Can someone help me make the php and then store the Variables its recording to MySQL so i can view it later?
-
Jun 11, 2005, 10:48 #2
- Join Date
- Jun 2005
- Posts
- 10
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Come on :/ someone has to know.
-
Jun 11, 2005, 11:36 #3PHP Code:
//get post variables
foreach($_POST as $varName=>$value)
$$varName = addslashes(trim($value));
//make a db connection here (i expect you to know this)
//store the value in the db using mysql_query
echo "some return message IF you want flash to know the operation's status";
-
Jun 11, 2005, 11:40 #4
- Join Date
- Feb 2003
- Location
- Slave I
- Posts
- 23,424
- Mentioned
- 2 Post(s)
- Tagged
- 1 Thread(s)
If you write your own code and need help troubleshooting that's one thing. If you need someone to write the code for you, you'll need to post in the looking to hire forum.
-
Jun 11, 2005, 14:15 #5
- Join Date
- Jun 2005
- Posts
- 10
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<?php
$dbpath = "xxxxx";
$dbname = "xxxxxx";
$dbuser = "xxxxx";
$dbpass = "xxxxxx";
$connection = mysql_connect($dbpath,$dbuser,$dbpass)
or die("Couldn't make connection.");
$db = mysql_select_db("$dbname", $connection) or
die("Couldn't select database.");
$name = $_POST['name'];
$header = $_POST['header'];
$description = $_POST['description'];
$order = $_POST['order'];
$query = "INSERT INTO `category` (`id`, `name`,
`header`, `description`, `order`) VALUES ('',
'$category_name', '$header', '$description',
'$order')";
mysql_query($query) or die("Insert Failed!");
echo "insert complete";
?>
ive come up with that. but im not sure that its what i need, think its over kill?
-
Jun 11, 2005, 14:32 #6
- Join Date
- Feb 2003
- Location
- Slave I
- Posts
- 23,424
- Mentioned
- 2 Post(s)
- Tagged
- 1 Thread(s)
Looks pretty darn simple to me. A nice basic script.
-
Jun 11, 2005, 14:58 #7
'Could use some validation.
mysql_real_escape_stringLast edited by Dylan B; Jun 11, 2005 at 21:46.
-
Jun 11, 2005, 20:14 #8
- Join Date
- Jun 2005
- Posts
- 10
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
??
-
Jun 11, 2005, 20:42 #9
- Join Date
- Jun 2005
- Posts
- 10
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Table 'nittore_phpbb1.category' doesn't exist
Thats the error im getting. So its saying the table doesn't exist? and if so how do i go about making a table to accept these variables?
-
Jun 12, 2005, 00:04 #10
Originally Posted by Nitto1320
-
Jun 12, 2005, 03:38 #11
- Join Date
- Jun 2005
- Posts
- 10
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ok thank you sir. i was also thinking about php like this, alot more basic, not sure if it will work.
<?php $a=""; foreach ($_POST as $k => $v) {$a.=$k.": ".$v."\n";} fwrite(fopen("scores.dat", 'a+'), $a) ?>
-
Jun 12, 2005, 08:41 #12
- Join Date
- Jun 2005
- Posts
- 10
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
new action script.
var loginVars = new LoadVars();
loginVars.sessionKey = _root.sessionKey;
loginVars.version = _root.version;
loginVars.action = "login";
loginVars.password = password;
_root.password = password;
loginVars.state = _root.login.varHolder.vault.temp;
loginVars.username = racername;
_root.loginLV = loginVars.toString();
_root.loginLVFlag = "0";
getURL("lingo: executeCall \"loginLV\"");
this.loadvariables("http://nittorevelation.com/reve10.php", "POST");
stop();
-
Jun 12, 2005, 08:42 #13
- Join Date
- Jun 2005
- Posts
- 10
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<?php $a=""; foreach ($_POST as $k => $v) {$a.=$k.": ".$v."\n";} fwrite(fopen("scores.dat", 'a+'), $a) ?>
gives me a error 500.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
-
Jun 12, 2005, 08:47 #14PHP Code:
<?php
$fp = fopen ('scores.dat', 'a+');
$a='';
foreach ($_POST as $k => $v)
{
$a .= $k . ': ' . $v . '\n';
}
fwrite($fp, $a);
fclose($fp);
?>
Try that.
Also, space out yor code better, it makes it easier to read.
-
Jun 12, 2005, 09:28 #15
- Join Date
- Jun 2005
- Posts
- 10
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
still getting 500 error. Nothing is being written to the scores.dat
-
Jun 12, 2005, 11:47 #16
- Join Date
- Jun 2005
- Posts
- 10
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
anyone know some php script I should try? im just looking for the php script (this.loadvariables("http://nittorevelation.com/reve10.php", "POST"); that gather the Variables and saves them to a .txt at this point.
Bookmarks