Emergency Help!!

I want to do deletion. According to “name” but If checkbox is selected I will do deletion.

It is not work! Can we help me? Thank you in advance…

--------------delete.php--------

Onaylıyorum ---------------------------------------------------------------------------------------------------------------------------

-----------checkbox.php--------------

<?php $ad=$_POST[ad]; mysql_connect("localhost","root",""); mysql_select_db("deneme"); if(isset($_POST['onay'])){ $bilgi=mysql_query("delete from ali where Name like '$ad'"); //$count=mysql_num_rows($bilgi); for($i=0;$i<$count;$i++){ $ad=mysql_result($bilgi,$i,"Name"); $soyad=mysql_result($bilgi,$i,"Surname"); $adres=mysql_result($bilgi,$i,"Address"); $tel=mysql_result($bilgi,$i,"Tel"); echo "$ad,$soyad,$adres,$tel"; echo "
"; } echo "Deletion is successful"; } else{ echo "Failed....."; } ?>

[php]
$ad=$_POST[ad];
[/php]
Change to

[php]
$ad = $_POST[‘ad’];
[/php]
You’re also not passing $_POST[‘ad’] through the form. The only thing your form is passing is “onay” which is the checkbox.

Try the following : 8)

[php]<?php
$ad=$_POST[‘onay’];
mysql_connect(“localhost”,“root”,"");
mysql_select_db(“deneme”);

       if(isset($_POST['submit'])){

$bilgi=mysql_query(“delete from ali where Name like ‘$ad’”);
//$count=mysql_num_rows($bilgi);

for($i=0;$i<$count;$i++){

$ad=mysql_result($bilgi,$i,“Name”);
$soyad=mysql_result($bilgi,$i,“Surname”);
$adres=mysql_result($bilgi,$i,“Address”);
$tel=mysql_result($bilgi,$i,“Tel”);
echo “$ad,$soyad,$adres,$tel”;
echo “
”;
}
echo “Deletion is successful”;
}

else{
echo “Failed…”;
}
?> [/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service