Jump to content

Recommended Posts

 

echo"<td align=center><a href='delete.php?prem77=$row[premPropertyID]'><font size=2 color='#666666'>".Delete."</font></a></td>";

 

 

in delete.php

<?php
if(isset($_GET[prem77])){
$connection=mysql_connect($server, $user, $pass);
if(!$connection)					
	die("Connection failed");		

else
{							
	mysql_select_db($db);							
	$query = "delete from prem_propertyad where premPropertyID = '".$_GET[prem77]."' ";		

	$exec=mysql_query($query);

	echo '<script>alert("Property deleted");</script>';
	echo '<script>window.location="myneuproperty-postings.php";</script>';
}
}?>

 

 

how do i add in the warning to prompt " Are u sure want to delete?" with yes or no button

Link to comment
https://forums.phpfreaks.com/topic/74685-delete-function/
Share on other sites

THATS JAVA SCRIPT  not php ;D

 

try this simple sample

<html>
<head>
<script type="text/javascript">
function disp_confirm()
  {
  var r=confirm("Press a button")
  if (r==true){
    return true;
    }
  else
    {
    return false;
    }
  }
</script>
</head>
<body>
<a href="#" onClick="disp_confirm()">#</a>

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/74685-delete-function/#findComment-377581
Share on other sites

so how should i put this

if(!$connection)					
	die("Connection failed");		

else
{							
	mysql_select_db($db);							
	$query = "delete from prem_propertyad where premPropertyID = '".$_GET[prem77]."' ";		

	$exec=mysql_query($query);

	echo '<script>alert("Property deleted");</script>';
	echo '<script>window.location="myneuproperty-postings.php";</script>';
}

Link to comment
https://forums.phpfreaks.com/topic/74685-delete-function/#findComment-377607
Share on other sites

if you give me the full code i can implement it for you angel

 

but all you really need is the following in your delete button

<input type="submit" value="Delete" onClick='if(submit
("Are you sure you want to delete this?")) return ; 
else return false;'>

Link to comment
https://forums.phpfreaks.com/topic/74685-delete-function/#findComment-377609
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.