Go Back   Access World Forums > Apps and Windows > Web Design and Development

 
Reply
 
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
Old 02-06-2006, 09:50 AM   #1
method
Registered User
 
Join Date: Mar 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
method is on a distinguished road
Arrow probleming writing dynamic value into text file

Hi all. i have a little problem writing dynamic value to a ram.txt file. I want write the following infor int a text file:
Code:
<player showDisplay="yes" showPlaylist="yes" autoStart="yes">
  <song path="http://localhost/flash_mp3_player/mp3/08 - Track 8.mp3" title="tajik" /> 
  <song path="http://localhost/flash_mp3_player/mp3/13 - Gar Aya.mp3" title="gar aya" /> 
  </player>
The song path for each song id i pass.
<player showDisplay="yes" showPlaylist="yes" autoStart="yes">
and
</player>
are written once at the start and end of the text file.The title is just the name of song without .mp3 extention.

Currently when i call the code like this:

http://localhost/player/ram4.php?sid=1,2,

the only information which is get written to text file is the url but i want write song path and title in above mention format.

I be happy if an expert help me here.Thanks

ram4.php code
Code:
<?php


$url[1] = "http://localhost/flash_mp3_player/mp3/08 - Track 8.mp3";
$url[2] = "http://localhost/flash_mp3_player/mp3/13 - Gar Aya.mp3";
$url[3] = "http://localhost/flash_mp3_player/mp3/Soroush - Yeh Donya - 02 Shoghe Nafas.mp3";

$mycontent = "";
if (isset($_GET["sid"]))
{
   $allsid = explode (",",$_GET["sid"]);
   $mycontent = array();
   foreach ($allsid AS $value)
      $mycontent[] = $url[$value];
}

echo $mycontent;

$handle = fopen ("ram.txt","w+");
if ($handle)
{
  if (fwrite ( $handle,implode("\r\n",$mycontent)."\r\n") )
  {
      echo "FILE IS WRITTEN SUCCESSFULLY";
  } else
  {
       echo "ERROR IN WRITING TO FILE";
  }
  fclose ($handle);
} else
{
      echo "ERROR IN OPENING FILE";
}
require 'config.txt';
?>

method is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I return to BOF in text file NJudson Modules & VBA 6 12-01-2004 02:24 PM
exporting to txt file, with text data from lookup and to keep under 320 bytes ozlander General 11 11-13-2004 02:41 AM
Convert Excel file into Text file polina Modules & VBA 1 02-07-2003 09:44 AM
[SOLVED] writing to text file brycelester Modules & VBA 3 01-17-2003 06:30 AM
Text File Problem KDg Reports 0 10-28-1999 09:02 AM




All times are GMT -8. The time now is 06:52 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World