Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Trinti is duomenu bazes

Parašė JaWa· 2010 Spa. 21 16:10:41
#5

neveikia vistiek ... Stai dar vienas kodas. bet kai ikeliu linkus stulpeliu, man vistiek 1 istrina ... :/


<?php
require_once "maincore.php";
if(!iSUPERADMIN) exit('Access denied! :@');
require_once THEMES."templates/header.php";
 
 
/*
And2s's productions 8) 
(c) 2010 
*/
 
 
if (isset($_POST['delete'], $_POST['urls'])) {
 $to_delete = explode("\n", $_POST['urls']);
  $err = 0; $query = '';
  $i = 0;
 foreach ($to_delete as $url) {
 $query .= ($i !== 0 ? 'OR ' : '') . "download_url = '".addslashes($url)."'";
 $i++;
 }
   $result = dbquery("DELETE FROM ".DB_PREFIX."downloads WHERE ($query)");
  if (!$result) {
   $err = 1; 
  } 
 
 if ($err !== 0) {
  opentable('Klaida');
   echo "<center>Nepavyko ištrinti/center>\n";
  closetable();
 } else {
  opentable('Pavyko');
   echo "<center>Visi siuntiniai pagal jūsų įrašytas nuorodas sėkmingai ištrinti!</center>\n";
  closetable();
 }
}
 
opentable("Trinimas");
 echo "<form method='post' action=''>\n";
 echo "<textarea name='urls' class='textbox' rows='15' cols='20' style='width:400px'></textarea><br />\n";
 echo "<input type='submit' name='delete' value='Šalinti' class='button' />\n";
 echo "</form>\n";
closetable();
 
require_once THEMES."templates/footer.php";
?>