Location: PHPKode > scripts > Open4Listing > cont/deleteanunt.php
<?php
$idoferta=$_GET["anuntnr"];
function delete($idoferta)
{
include('../setari.php');
$del0 = @ConnectToDb($dbServer, $dbUser9, $dbPass9, $dbName9);
$verifica = mysql_query("SELECT * FROM oferte WHERE idoferta = '$idoferta'")or die(mysql_error()); 
while($myzzz = mysql_fetch_array( $verifica ))

{
$ppoza1=$myzzz[poza1];
$ppoza2=$myzzz[poza2];
$ppoza3=$myzzz[poza3];
$ppoza4=$myzzz[poza4];
$ppoza5=$myzzz[poza5];

if($myzzz["pass"]==$_COOKIE[vanzinch_pass])
{
mysql_query("delete from oferte where idoferta=$idoferta")or die("Query failed 0");
mysql_query("delete from poza1 where id=$idoferta")or die("Query failed 1");
mysql_query("delete from poza2 where id=$idoferta")or die("Query failed 2");
mysql_query("delete from poza3 where id=$idoferta")or die("Query failed 3");
mysql_query("delete from poza4 where id=$idoferta")or die("Query failed 4");
mysql_query("delete from poza5 where id=$idoferta")or die("Query failed 5");


if($ppoza1=="da")
{
$myFile = "../poze/".$idoferta."_1.jpeg";
unlink($myFile);
$myFile2 = "../poze/".$idoferta."_1_mic.jpeg";
unlink($myFile2);
}

if($ppoza2=="da")
{
$myFile3 = "../poze/".$idoferta."_2.jpeg";
unlink($myFile3);
}		

if($ppoza3=="da")
{
$myFile33 = "../poze/".$idoferta."_3.jpeg";
unlink($myFile33);
}
		
if($ppoza4=="da")
{
$myFile4 = "../poze/".$idoferta."_4.jpeg";
unlink($myFile4);
}	

if($ppoza5=="da")
{
$myFile5 = "../poze/".$idoferta."_5.jpeg";
unlink($myFile5);
}





MYSQL_CLOSE();



	header("Location: cont.php"); 	

		

}else{

echo "eroare! va rugam contactati administratorul!";

}



}}



switch($_GET["action"])

	{

		case "add_item":

		{

			break;

		}



case "delete":

		{

			delete($idoferta);

			break;

		}

}



?>
Return current item: Open4Listing