Anyone plz help me, i m having mp3 tag editor with all songs in one folder by just adding path, but currently facing problem that when i enter path for folder number 1 it edits tags as i want but when i give path of secong folder whos tag is to edit that time tags of 1 folder also get edited . Due to that site name in songs tag comes so many times in folder 1 and so on. So please i have posted index.php so edit in such a way that it shold edit tag of that folder only of which path has given.
PHP Code:
<html><head><title>Mp3 Tag Editor</title>
<style>body {
font: 12px Verdana, Arial, Helvetica, sans-serif;
}
input{
border: 1px solid #b90000;
margin: 1px;
}</style>
</head>
<body>
<?php
$docroot = realpath((getenv('DOCUMENT_ROOT') && preg_match('#^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))).'#', realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__))));
$basedir = '/files/';
$go=$_REQUEST["go"];
$dir = realpath($docroot.'/'.$basedir);
if($go!="")
{
if(!is_dir($dir))
print "Folder Does not Exist<br>";
else {
require_once('../mp/getid3/getid3.php');
require_once('./func.php');
require_once('./config.php');
$ext=array();
$scan=scanDirectories($dir);
$total=count($scan);
//print $total;
for($i=0;$i<$total;$i++)
{
$Filename=$scan[$i];
if(stristr($Filename,".mp3"))
{print $Filename.'<br>';
changer($Filename,$img,$change,$replace);
}
//
}
}
}
?><p>
<b>Enter the path To edit tag</b>
<p>
<form align="center"><input type="text" name="dir"/><br/>
<input type="submit" value="Go" name="go"/>
</form>
</p></p></body></html>
Comment