Hi all,
Regarding this topic
I am having an issue with a flash and php script my flash file isnt submitting the changes to my php script located at my site demo.willbc.com/joomla/update.php
i get no errors
this is my php code
$name=$_POST['username'];
$cp=$_POST['cexp'];
$mp=$_POST['mexp'];
$hpy=$_POST['happy'];
$e=$_POST['energy'];
$conf=$_POST['confidence'];
$gold=$_POST['money'];
$name=$_POST['username'];
$lastLogin=$_POST['lastLogin'];
$lastConfidenceReplenish=$_POST['lastConfidenceReplenish'];
$lastEnergyReplenish=$_POST['lastEnergyReplenish'];
$curEnergy=$_POST['curEnergy'];
$curConfidence=$_POST['curConfidence'];
$sparePoints=$_POST['sparePoints'];
$foodLog=$_POST['foodLog'];
$achievements=$_POST['achievements'];
$money=$_POST['money'];
$recent=$_POST['recent'];
$activities=$_POST['activities'];
$thoughtList=$_POST['thoughtList'];
$inventoryItems=$_POST['inventoryItems'];
$lastSave=$_POST['lastSave'];
$energy=$_POST['energy'];
//
//
include("dbconnect.php");
$u="update gg46_users set cexp='$cp',mexp='$mp',energy='$e',happy='$hpy',confidence='$conf',money='$gold'
,lastvisitDate='$lastLogin',lastConfidenceReplenish='$lastConfidenceReplenish',lastEnergyReplenish='$lastEnergyReplenish',
curEnergy='$curEnergy',curConfidence='$curConfidence',sparePoints='$sparePoints',foodlog='$foodLog',achievements='$achievements',confidence='
$confidence',recent='$recent',activities='$activities',thoughtList='$thoughtList',inventoryItems='$inventoryItems',lastSave='$lastSave' WHERE username='$name'";
//echo $u;
$rs=mysqli_query($con,$u);
if(!$rs)
{
//
echo "Somthing Went Wrong".mysqli_error($con);
//
}
else
{
echo "Successful Update";
}
//
as for flash file this is my flash action script code
public static const WEB_ADDRESS_GET:String = "site.com/site.php";
public static const WEB_ADDRESS_SEND:String = "site.com/siteget.php";
private static const LOGGED_USER_REQUEST:int = 1;
private static const GET_USER_DATA:int = 2;
private static const SEND_USER_DATA:int = 3;
private var commStatus:int = 0;
private var req:URLRequest = new URLRequest(WEB_ADDRESS_GET);
private var loader:URLLoader = new URLLoader();
private var URLvars:URLVariables = new URLVariables();
private var myParent:Object = null;
public function Comms():void {
As for the actionscript for response i get this but abit of a delay
public function saveData(dataToSave:Object, _myParent:Object = null):void {
myParent = _myParent;
req = new URLRequest(WEB_ADDRESS_SEND);
req.method = URLRequestMethod.POST;
URLvars.data = dataToSave;
//or ----------
//URLvars = dataToSave;
//req.data = URLvars;
req.data = dataToSave;
loader.addEventListener(Event.COMPLETE, onSaved);
loader.load(req);
}
function onSaved(e:Event):void {
if (myParent != null) {
flash(myParent).debug(" data saved...");
} else {
trace('data saved...');
}
}
What is going on here why is no data being sent to my php file?
How can i get data to be updated everytime when save data is called?
Can anyone help?
Thanks,William