Im trying to fetch some data from PHP and use it in a link in flash AS3.
flash code:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE,onLoaded);
loader.load(new URLRequest("FLA_connect.php"));
var variables:URLVariables = new URLVariables();
signup.addEventListener(MouseEvent.MOUSE_DOWN, mouseClick);
function onLoaded(evt:Event):void
{
var data:URLVariables = new URLVariables(evt.target.data);
variables.sponny = data.spon;
}
function mouseClick(event:MouseEvent):void
{
navigateToURL(new URLRequest('http://www.website.com/'+variables.sponny),"_self");
}
FLA_connect.php code:
<?php
require ('config.php');
print "spon=$username";
?>
I've tested FLA_connect.php and it returns the correct data but when tested in flash, the variable returns as undefined so i end up with a link www.website.com/undefined.
Any ideas guys??
thanks
For shanethehat
<?
require ('../config/db_4554651684654548784216.php'); //DB connection info is stored
require ('conf_id.php'); //this file holds the value for $lead_reference
mysql_connect($hostname,$username,$password) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$get__id_check = mysql_query("SELECT * FROM $usertable WHERE ". "idEmail_lead = '$lead_reference'");
while($id__check = mysql_fetch_array($get__id_check)) {
$first_N = $id__check["First_Name"];
$last_N = $id__check["Last_Name"];
$email_add = $id__check["Email"];
$GDI__username = $id__check["GDI_Username"];
}
?>