How to limit getid3 to read only mp3s in demo.browse.php

The place for "I can't figure out how to..." questions.
Post Reply
tony98
User
Posts: 23
Joined: Mon Feb 13, 2006 5:47 am

How to limit getid3 to read only mp3s in demo.browse.php

Post by tony98 » Mon Feb 13, 2006 10:36 am

Hi all i recently downloaded getid3 version 1.7.5-200512251515. It had a file inside demo folder called demo.browse.php. I use it to upload mp3 information to mysql db. The problem is that i do not know how to force the script to ignore non mp3 files .Furthermore, how save file path to database like this : http://localhost/wimpyv5/mp3s/songname.mp3
instead of

c:/wamp/www/wimpyv5/mp3s/songname.mp3

I be happy if an expert help me with this.Thanks

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Thu Feb 16, 2006 7:33 pm

1. You make getID3() ignore a certain file by not running the analyze() method on that file. Feel free to delete all other modules than mp3 if you want to enforce it.

2. str_replace('c:/wamp/www', 'http://localhost', $filename)

tony98
User
Posts: 23
Joined: Mon Feb 13, 2006 5:47 am

Post by tony98 » Fri Feb 17, 2006 2:48 am

Allan Hansen wrote:1. You make getID3() ignore a certain file by not running the analyze() method on that file. Feel free to delete all other modules than mp3 if you want to enforce it.

2. str_replace('c:/wamp/www', 'http://localhost', $filename)
Thank u for u reply. I am more intrested in demos/demo.mysql.php then demo.browse.php. I looked at demo.mysql.php code and found many places using analyze such as $ThisFileInfo = $getID3->analyze($filename); . In order that i ignore non mp3 files what should i do with it?Could u tell me exactly what needs to be changed since i am not very experienced with php.Furthermore, where should i use this line of code str_replace('c:/wamp/www', 'http://localhost', $filename) so that the path get stored correctly?I be happy if u help me with these problems.Thanks

Post Reply