Just getting my feet wet with LoadVars by passing variables to PHP with: (mysql on windows 03 server)
var myVars:LoadVars = new LoadVars(); myVars.id = 21; myVars.hit = 99; myVars.send("http://local/updateHit.php", "_self", "POST");
My PHP code:
<?php include_once("include/core.php"); /*DB connections, etc */ $id = $_POST["id"]; $hit = $_POST["hit"]; $stmt = "UPDATE my_table SET hit = ". $db->Quote($hit) . " WHERE id = $id "; if ( !$db->Execute($stmt)) echo $db->ErrorMsg(); ?>
However, test running this shows that flash is calling it as
so the script does not work unless I change the $_POST to $_GET (and that works) …umm I’m confused, I thought I specified “POST” in my AS?
Edit : Umm I realized I should be testing it in the browser :d: