Location: PHPKode > scripts > Lyrics Submitter > lyrics-submitter/admin.php
<?php 
/////////////////////////////////
//Lyrics submitter by jakez     /
//Email: hide@address.com/
//Website: http://www.jakez.net /
/////////////////////////////////
include ("config.php");

$auth = 0; 
if (($PHP_AUTH_USER == $login ) && ($PHP_AUTH_PW == $password )) $auth = 1; 
if ( $auth != 1 ) { 
    header( "WWW-Authenticate: Basic realm=\"Authorization Required!\"" ); 
    header( "HTTP/1.0 401 Unauthorized" ); 
    echo 'Authorization Required!'; 
    exit; 
}

if ($action == "delete")
 {
  unlink($dirpath . $file);
  echo ("<script language=\"JavaScript\">window.location='admin.php'</script>");
 }


if ($action == "accept")
 {
  rename($dirpath . $file, $dirpath . str_replace(".dat","",$file) . ".txt");
  echo ("<script language=\"JavaScript\">window.location='admin.php'</script>");
 }


if ($action == "")
 {
 echo ($Style);
 echo ($sHeaderHTML);

 $sDirectory = (opendir($dirpath));
 $lCount = (0);
  while ($sFile = readdir($sDirectory))
   {
      $sFiles[$lCount] = $sFile;
      $lCount++;
   }

 sort($sFiles);
 unset ($lCount);
 
  for ($lCount; $lCount <= count($sFiles); $lCount++)
   {
      $sFileTemp = ($sFiles["$lCount"]);
      $sStrLen = (strlen($file));
      $sExtTemp = (substr($sFileTemp, $sStrLen - (3), 3));
        if ($sExtTemp == "dat")
          {
             $sFileTemp = str_replace(".dat","",$sFileTemp);
             $sFileArray = (explode("-", $sFileTemp));
               if ($sFileArray[0] != "" && $sFileArray[1] != "")
                {
                   echo ($sBeforeHTML . "(<a href=\"admin.php?action=accept&file=$sFileArray[0]-$sFileArray[1].dat\">Accept</a>) (<a href=\"admin.php?action=delete&file=$sFileArray[0]-$sFileArray[1].dat\">Delete</a>) <a href=\"$sFileArray[0]-$sFileArray[1].dat\">$sFileArray[0]</a>" . $sAfterHTML . $sBeforeHTML . "<a href=\"$sFileArray[0]-$sFileArray[1].dat\">$sFileArray[1]</a>" . $sAfterHTML . $sSplitHTML);
                }
          }
   }
 echo ($sFooterHTML);
 }
?>
Return current item: Lyrics Submitter