Location: PHPKode > projects > Audio-Portal > create_artist.php
<?php
require_once('functions/func.php');

adminonly();

$page="Create Artist";

eval(tpl('header'));
echo "
<table align=\"center\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"> 
 <tr> 
  <td valign=\"top\" align=\"center\" width=\"16%\">";

eval(tpl('menu'));

echo "
  </td>
  <td width=\"1%\"></td>
  <td valign=\"top\" align=\"center\" width=\"83%\">";


$act=(isset($_POST['act']))?$_POST['act']:'';

if ($act=='send') {

   $name=(isset($_POST['name']))?$_POST['name']:'';
   $dbirth=(isset($_POST['dbirth']))?$_POST['dbirth']:'';
   $country=(isset($_POST['country']))?$_POST['country']:'';
   $homepage=(isset($_POST['homepage']))?$_POST['homepage']:'';
   //$=(isset($_POST['']))?$_POST['']:'';
   //$=(isset($_POST['']))?$_POST['']:'';
   if ($name!='') {

debug("INSERT INTO `artist` (`arname`, `dbirth`, `lbirth`, `homepage`) VALUES (".sqlesc($name).", ".sqlesc($dbirth).", ".sqlesc($country).", ".sqlesc($homepage).")");

      $save=query("INSERT INTO `artist` (`arname`, `dbirth`, `lbirth`, `homepage`) VALUES (".sqlesc($name).", ".sqlesc($dbirth).", ".sqlesc($country).", ".sqlesc($homepage).")");
      $id=mysql_insert_id();
      query("INSERT INTO artdescr ( arid, ardescr ) VALUES ('".$id."', '')");
      if ($save) $mess="Your data was successfully saved.";
      else $mess="There was an SQL error!";
      }
   else $mess="Please provide a name!";

   eval(tpl('create_artist_mess'));

}
else eval(tpl('create_artist'));

echo "
  </td>
 </tr>
</table>";
eval(tpl('footer'));
?>
Return current item: Audio-Portal