Location: PHPKode > scripts > Lyrics Submitter > lyrics-submitter/add.php
<?
include ("config.php");

echo ($Style);

if($artist == "" || $song == "" || $lyrics == "")
 {
  $HTML = ($sHeaderHTML);
  $HTML .= ("<form method=\"post\" action=\"add.php\">");
  $HTML .= ($sBeforeHTML . "Your name:" . $sAfterHTML . $sBeforeHTML . "<input name=\"adder\"><br>" . $sAfterHTML . $sSplitHTML);
  $HTML .= ($sBeforeHTML . "Your URL/email:" . $sAfterHTML . $sBeforeHTML . "<input name=\"adderinfo\"><br>" . $sAfterHTML . $sSplitHTML);
  $HTML .= ($sBeforeHTML . "Artist:" . $sAfterHTML . $sBeforeHTML . "<input name=\"artist\"><br>" . $sAfterHTML . $sSplitHTML);
  $HTML .= ($sBeforeHTML . "Song name:" . $sAfterHTML . $sBeforeHTML . "<input name=\"song\"><br>" . $sAfterHTML . $sSplitHTML);
  $HTML .= ($sBeforeHTML . "Lyrics:" . $sAfterHTML . $sBeforeHTML . "<textarea name=\"lyrics\" rows=\"10\" cols=\"40\"></textarea><br>" . $sAfterHTML . $sSplitHTML);
  $HTML .= ($sBeforeHTML . "<input type=\"submit\" value=\"Submit\">" . $sAfterHTML);
  $HTML .= ($sBeforeHTML . "<input type=\"reset\" value=\"Reset\">" . $sAfterHTML);
  $HTML .= ($sFooterHTML);
  print ($HTML);
 }
  else
 {
  if($autoadd == (false))
   {
    $filename = ($artist."-".$song.".dat");
   }
    else
   {
    $filename = ($artist."-".$song.".txt");
   }
  if(file_exists($filename))
   {
    echo ("The lyrics you submitted already exist");
   }
    else
   {
    $data .= "Artist: ".$artist."\n";
    $data .= "Song name: ".$song."\n";
    $data .= "Added by: ".$adder." (".$adderinfo.") ".date("l F j g:i a")."\n\n";
    $data .= "Lyrics:\n".$lyrics;
    $openfile = fopen(("$filename"),"w");
    fwrite($openfile, "$data");
    fclose($openfile);
    echo ("<script language=\"JavaScript\">window.location='index.php'</script>");
   }
 }
?>
Return current item: Lyrics Submitter