Hi there all this is my first post woop! woop! ;D
I have a successful guestbook & download manager working on my DB.
The download_manager table is as follows [only 5 showing examples … have 1 to 40]
id FILE DOWNLOADS
== === ============
1 01.zip 34
2 02.zip 7
3 03.zip 11
4 04.zip 0
5 05.zip 1
if I specify the row with the id value, all I want to view is the corresponding DOWNLOADS value on the same row.
[php]
<?php error_reporting(E_ALL^E_NOTICE); require('connect.php'); $id = $_GET['xx']; $result = mysqli_query("SELECT * FROM download_manager WHERE id = '$id'"); $data = mysqli_fetch_assoc($result); $result->close(); $body = $data['DOWNLOADS']; echo "returnBody=$body"; ?>[/php]
And This is my Action Script code for the page to view the result.
//--###### IMPORT ######--//
import flash.events.Event;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLLoader;
//--# DOWNLOAD COUNTER #--//
var urlVariables:URLVariables = new URLVariables();
var request:URLRequest = new URLRequest("update.php?xx=1");
request.data = urlVariables;
var getVariables:URLLoader = new URLLoader();
getVariables.dataFormat = URLLoaderDataFormat.VARIABLES;
getVariables.addEventListener(Event.COMPLETE, completeHandler);
getVariables.load(request);
function completeHandler(event:Event):void
{
dCounter.text = "" + event.target.data.returnBody;
}
//--# DOWNLOAD BUTTON #--//
dload01.addEventListener(MouseEvent.MOUSE_OVER, dOver);
dload01.addEventListener(MouseEvent.MOUSE_OUT, dOut);
dload01.addEventListener(MouseEvent.CLICK, dClick);
function dClick(e:MouseEvent):void
{
navigateToURL(new URLRequest("download.php?file=temp_01.zip"), '_self');
}
function dOut(e:MouseEvent):void
{
dload01.gotoAndPlay("out");
}
function dOver(e:MouseEvent):void
{
dload01.gotoAndPlay("over");
}
//--####### STOP #######--//
Hope someone can help
Steven