Jump to content

scottiescotsman

Members
  • Posts

    22
  • Joined

  • Last visited

Recent Profile Visitors

1,608 profile views

scottiescotsman's Achievements

Member

Member (2/5)

0

Reputation

1

Community Answers

  1. Rather than echo $xmlBody I want to be able to save it to file as in mp3_tags.xml? Thanks Steven
  2. <?php header("Content_Type: text/xml"); $xmlBody = '<?xml version="1.0" encoding="ISO-8859-1"?>'; $dir = "SOUNDS/"; $xmlBody .= "<XML>"; $dirHandle = opendir($dir); $i = 0; while ($file = readdir($dirHandle)) { if(!is_dir($file) && strpos($file, '.mp3')){ $i++; $myId3 = new ID3($file); $xmlBody .= ' <Song> <songNum>' . $i . '</songNum> <songURL>' . $dir . '' . $file . '</songURL> <songArtist>' . $myId3->getArtist() . '</songArtist> <songTitle>' . $myId3->getTitle() . '</songTitle> </Song>'; } } closedir($dirHandle); $xmlBody .= "</XML>"; echo $xmlBody; ?> Hi there, I have designed a flash mp3 player that reads the id3 tags form the .mp3 file, but wanted to make a XML list generated by PHP & to add the mp3 tags to the XML file so that flash can view all the id3 tag information on the files, and show on the list. I know how to view the XML list in flash I just don't want to type out 500+ tags of XML lol here is something I tried ...
  3. <?php require_once ('connect.php'); $id = $_GET['xx']; $body = ""; if ($id == 0) { $body = '<b><font color="#009999" size="11">NO DATA</font></b>'; } else { $result = mysql_query("SELECT * FROM download_manager WHERE id = $id"); $row = mysql_fetch_assoc($result); $body = '<b><font name="Teen" color="#009999" size="13" align="left">'.$row['DOWNLOADS'].'</font></b>'; } echo "returnBody=$body"; exit(); ?> All fixed now
  4. <?php error_reporting(E_ALL^E_NOTICE); require_once 'connect.php'; $id = $_GET['xx']; $body = ""; $sql = mysql_query("SELECT * FROM download_manager WHERE id = $id"); $row = mysqli_fetch_assoc($sql); $downloads = $row["DOWNLOADS"] $body .= '<b><font name="Teen" color="#009999" size="11">' . $downloads . '</font></b>'; mysql_free_result($sql) mysql_close(); echo "returnBody=$body"; exit(); ?> [php] please, please can someone help with this as it is so simple but cant get it to work & have been at it for 2-3 weeks. Its so easy its dumb. TABLE AS FOLLOWS id FILE DOWNLOADS == === ============ 1 01.zip 34 2 02.zip 7 3 03.zip 11 4 04.zip 0 5 05.zip 1 All I want is the download column where I specify the id to show in flash AS3. [AS] var variables_re:URLVariables = new URLVariables(); var varSend_re:URLRequest = new URLRequest("update.php?xx='1'"); varSend_re.method = URLRequestMethod.POST; varSend_re.data = variables_re; var varLoader_re:URLLoader = new URLLoader; varLoader_re.dataFormat = URLLoaderDataFormat.VARIABLES; varLoader_re.addEventListener(Event.COMPLETE,completeHandler_re); function completeHandler_re(event:Event):void{ if(event.target.data.returnBody==""){ dCounter.textField.opaqueBackground = 0x333333; dCounter.text="No data coming through." }else{ dCounter.editable = false; dCounter.condenseWhite = true; dCounter.textField.opaqueBackground = 0xFFFFFF; dCounter.htmlText = "" + event.target.data.returnBody; } } variables_re.comType = "requestEntries"; varLoader_re.load(varSend_re); [/AS] everyone says code is good on both so why can I not see it on my page when loaded PLZ PLZ PLZ HELP
  5. OK I just went through a load of reading and got it to sort of work lol.... When I run my FLASH page and load the page for a specific file. The download_manager table is as follows [only 5 showing as example .. 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 is to view the corresponding DOWNLOADS value on same row. AS3 script on page.. //--###### IMPORT ######--// import flash.events.Event; import flash.net.URLRequest; import flash.net.URLVariables; import flash.net.URLLoader; //--# DOWNLOAD COUNTER #--// var request:URLRequest = new URLRequest("update.php?xx=1"); var getVariables:URLLoader = new URLLoader(); getVariables.dataFormat = URLLoaderDataFormat.VARIABLES; getVariables.addEventListener(Event.COMPLETE, completeHandler); getVariables.load(request); function completeHandler(event:Event):void { var urlVariables:URLVariables = new URLVariables(); var data = urlVariables.decode(event.target.data); dCounter.condenseWhite = true; dCounter.textField.opaqueBackground = 0x333333; dCounter.htmlText = "" + 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 #######--// PHP on server <?php error_reporting(E_ALL^E_NOTICE); require('connect.php'); $body=""; $result = mysqli_query("SELECT * FROM download_manager WHERE id = 'xx'"); $data = mysqli_fetch_assoc($result); $result->close(); $body = '<b><font name="Teen" color="#009999" size="11">' . $data['DOWNLOADS'] . '</font></b> '; echo "returnBody=$body"; exit(); ?> Gives an undefined result plzplz help Thanks Steven
  6. I have a flash website and want to view it on MovieClip, which I have got for every different file on my page. prob easier to go look at it. www.scottiescotsman.com and go to downloads then just click on the first 5 links as that is all that work at the moment. all are dummy zips .. just want to view the value of DOWNLOADS if I specify the id the downloads work and updates the download_manager table as I have checked, but cant get it to view the value of the amount of times its been downloaded as the page loads here is the as3 code I have.. viewing the value I cant seem to get really need help please //--###### IMPORT ######--// import flash.events.Event; import flash.net.URLRequest; import flash.net.URLVariables; import flash.net.URLLoader; //--# DOWNLOAD COUNTER #--// var request:URLRequest = new URLRequest("update.php?xx=1"); var getVariables:URLLoader = new URLLoader(); getVariables.dataFormat = URLLoaderDataFormat.VARIABLES; getVariables.addEventListener(Event.COMPLETE, completeHandler); getVariables.load(request); function completeHandler(event:Event):void { var urlVariables:URLVariables = new URLVariables(); var data = urlVariables.decode(event.target.data); dCounter.condenseWhite = true; dCounter.textField.opaqueBackground = 0x333333; dCounter.htmlText = "" + 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 #######--//
  7. DOWNLOADS is just the value of the amount of times the FILE has been downloaded i.e. [id]=2,[FILE]=01.zip,[DOWNLOADS]=45. I have a download.php which works great and increases the downloads by one every time the file is downloaded. All I want to do is view the amount of times its downloaded on FLASH page LOAD and if it is updated.
  8. I have a table named download_manager, with id, FILE & DOWNLOADS columns. All I want to do is view in FLASH MovieClip the downloads column of the row with the id I specify. Will this achieve this ? <?php error_reporting(E_ALL^E_NOTICE); require('connect.php'); $body=""; $result = mysqli_query("SELECT * FROM download_manager WHERE id = 'xx'"); $data = mysqli_fetch_assoc($result); $result->close(); $body = '<b><font name="Teen" color="#009999" size="11">' . $data['DOWNLOADS'] . '</font></b> '; echo "returnBody=$body"; exit(); ?> Thanks for your help Steven
  9. How do I view the attached update.php result in my Flash MovieClip as I have tried numerous attempt and failed every one Hope someone can help plz Thanks Steven [AS] import flash.events.Event; import flash.net.URLRequest; import flash.net.URLVariables; import flash.net.URLLoader; var returnBody:String = ""; var request:URLRequest = new URLRequest("update.php?xx=1"); var getVariables:URLLoader = new URLLoader(); getVariables.dataFormat = URLLoaderDataFormat.VARIABLES; getVariables.addEventListener(Event.COMPLETE, completeHandler); getVariables.load(request); function completeHandler(event:Event):void { dCounter.condenseWhite = true; dCounter.textField.opaqueBackground = 0x333333; dCounter.htmlText = "" + request; } 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"); } [/AS] update.php
  10. <?php error_reporting(E_ALL^E_NOTICE); require('connect.php'); $body=""; $result = mysqli_query("SELECT * FROM download_manager WHERE id = 'xx'"); $data = mysqli_fetch_assoc($result); $result->close(); $body = '<b><font name="Teen" color="#009999" size="11">' . $data['DOWNLOADS'] . '</font></b> '; echo "returnBody=$body"; exit(); ?> hope that's right
  11. Thanks for your reply I shall let you know how I get on. Thanks Steven
  12. Am I getting these examples right ... #1. I query one for the row to get the row data #2. another one to split the data up into id, FILE, DOWNLOADS so I can use the downloads data ? hope I am right Thanks for your help Steven
  13. Hi I am new to PHP & SQL but have managed to have a functioning guestbook and download counter. At present they both work but I cant seem to code how to get the download counter to display on my flash movie clip. I have tried numerous different ways but as I am new I don't really know what I am doing lol. The SQL table [download_mamager] is formatted as follows .... id, FILE, DOWNLOADS but all I want to do is get the value of the DOWNLOADS column at the row I specify. ie. $data = mysqli_query("SELECT DOWNLOADS FROM downloads_manager WHERE id = 'xx'"); and view the result on a flash textfield. hope someone can help cant seem to figure out how to add my as3 code here update.php
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.