#1
  1. No Profile Picture
    fantom
    Guest
    Devshed Newbie (0 - 499 posts)
    Is it possible to index a directory full MP3s located on a remote server with 'directory browsing' turned ON with PHP/MySQL combination script from another server, and get the filesizes, filenames (artist + song name, separated by "-") of those MP3s and store their info into a MySQL database, so it is later available for the browsing (I know how to add searching capabilities to it already)...?
    Or if not that, then is it possible to do the same thing if the songs were located on the same server as the mySQL database is?

    Please let me know if this is possible, and if yes, how?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Pune, Maharashtra, India
    Posts
    86
    Rep Power
    15
    It is very mch poosible and if you want you can download the whole script from www.hotscripts.com . You will need only a liitle modification to do.

    ------------------
    Nikunj Virani
    MYSQL/PHP/XML
    This is the world of Nikunj
  4. #3
  5. No Profile Picture
    fantom
    Guest
    Devshed Newbie (0 - 499 posts)
    Ok, I found this script on hotscripts.com - http://netamp.sourceforge.net/
    and I'll be trying to figure out how to install it (since I need root access but I don't have it)...
    If I run into any problems I'll come back for more help.

    Thanx for quick response.
  6. #4
  7. No Profile Picture
    fantom
    Guest
    Devshed Newbie (0 - 499 posts)
    Dang, I can't get this script to index the files in the specified directory...
    Can anyone else try to install the script on their own server (it's only 14kb in size I guess), and let me know if you can get it to work?
    It would be easier than if I started to post all kinds of code here...
  8. #5
  9. No Profile Picture
    fantom
    Guest
    Devshed Newbie (0 - 499 posts)
    Ok, I will be using a part of this code, but now I need to know how to print out a LIST BOX that is fed with the data from mySQL database... If there is a table called 'mp3data', and the fields that need to be printed are 'ID', 'artist', 'song'
    so it looks something like this:

    <form method="POST" action="download.php3">
    <div align="center">
    <p><b><font face="Verdana" size="2" color="#000000">Select the song and press the download button</font></b>
    <select name="ID" size=20>
    <OPTION VALUE=$ID>[$artist + $song]</select>
    ...
    The fields 'artist' and 'song' capture the name of the artist and song from an MP3 with all the underscores removed, so the listings are printed without any underscores or extensions.
    Can anyone help me with this code???
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Gig Harbor, Washington, USA
    Posts
    29
    Rep Power
    0
    I know nothing about MySQL, but:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <OPTION VALUE=$ID>[$artist + $song]</select>
    [/code]

    Remember when using variables you have to start with <? and ?>. HTML is stupid and won't know what to do If you'd like to print those variables, then do this:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <OPTION VALUE=<? echo $ID>[$artist + $song]; ?></select>
    [/code]

    Sorry If I'm not of much help, but hey I am a newbie myself!

    ------------------
    chris swanicke
    swanicke@defected.net
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Gig Harbor, Washington, USA
    Posts
    29
    Rep Power
    0
    Oh, and maybe use a function similar to StripSlashes (I have no idea) to remove the underscores? If there isn't one you can also use replace functions (it's called eng_replace() or something).

    Search the php.net quick reference

    EDIT: Make sure to set a maximum limit of characters for the Song/Artists. Otherwise a user may end up widening your dropdown list to 1000 characters

    ------------------
    chris swanicke
    swanicke@defected.net

    [This message has been edited by swanicke (edited September 01, 2000).]
  14. #8
  15. No Profile Picture
    fantom
    Guest
    Devshed Newbie (0 - 499 posts)
    All those values are already stored in the database, and I just need a way to print them out from mysql database...
    an example entry in the database would be:
    ID = 1
    Filename = DMX_-_Whatever.mp3
    Artist = DMX
    Song = Whatever
    Filesize = 3.54 (MB)

    and all I need to print from that table is

    <OPTION VALUE=[ID value here]>[artist - song] [filesize]

    so it looks like this:

    <OPTION VALUE=1>DMX - Whatever [3.54 MB]


    You get it?
    Now how do I pull out that data from database and print it for all the records...?

    [This message has been edited by fantom (edited September 01, 2000).]
  16. #9
  17. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Gig Harbor, Washington, USA
    Posts
    29
    Rep Power
    0
    Yea, see I know nothing about MySQL so I was just assuming it was like variables You'll have to ask a MySQL expert.

    Experts.. help him out!

    ------------------
    chris swanicke
    swanicke@defected.net
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Seattle, WA,USA
    Posts
    84
    Rep Power
    15
    Well You could try something like this:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    $sql = "SELECT * FROM musictable";
    mysql_connect('localhost','username','password');
    mysql_select_db('dbname');
    $result = mysql_query($sql);
    $number_of_rows = mysql_num_rows($result);
    ......//extra code

    for ($iindex = 0; $iindex < $number_of_rows; $iindex++) {
    $record = mysql_fetch_object($result);
    $song = $record->song;
    $artists $record->artist;
    $ID = $record->ID
    echo "
    <select name="ID" size=20>
    <OPTION VALUE=$ID>[$artist + $song]</select>
    ";
    }
    //..... bla bla

    ?>
    [/code]

    Try something like that.



    ------------------
    Jerome Gagner
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Seattle, WA,USA
    Posts
    84
    Rep Power
    15
    I am not an expert, just trying to help out

IMN logo majestic logo threadwatch logo seochat tools logo