Location: PHPKode > scripts > Open4Listing > cont/delete_free.php
<?php

$id=$_GET["id"];

$no=$_GET["no"];

$camp="poza".$no;

$camp_of="poza".$no;







function delete($id, $camp, $camp_of, $no)

	{

include('../setari.php');

$del0 = @ConnectToDb($dbServer, $dbUser9, $dbPass9, $dbName9);

$verifica = mysql_query("SELECT * FROM $camp WHERE id = '$id'")or die(mysql_error()); 

while($myzzz = mysql_fetch_array( $verifica )) {

if($myzzz["pass"]==$_COOKIE[vanzinch_pass])

{

mysql_query("delete from $camp where id=$id")or die("Query failed 0");	

$upd="UPDATE oferte SET $camp_of='nu' WHERE idoferta='$id' LIMIT 1";

$rsult = mysql_query($upd) or die("Query failed la Update");		



$myFile = "../poze/".$id."_".$no.".jpeg";

unlink($myFile);



if($no==1)

{

$myFile2 = "../poze/".$id."_".$no."_mic.jpeg";

unlink($myFile2);

}





	header("Location: detaliianunt.php?anuntnr=$id"); 	

		

}else{

echo "eroare! va rugam contactati administratorul!";

}



}}



switch($_GET["action"])

	{

		case "add_item":

		{

			break;

		}



case "delete":

		{

			delete($id, $camp, $camp_of, $no);

			break;

		}

}



?>
Return current item: Open4Listing