Click here to Skip to main content
15,894,539 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there
I have made a registration form using php and there is link called delete to delete a record from database table. I have made the delete code. Now I want to display a confirmation message and successful message when click the delete link. Can anyone tell me how to do that?

Here is my delete.php code:
PHP
$con = mysql_connect("localhost","root","");
	if (!$con)
  	{
  		die('Could not connect: '. mysql_error());
  	}

	mysql_select_db("user_database", $con);

 	$newsid = $_GET['ID'];
    $result = mysql_query("DELETE FROM personal_details WHERE ID=$newsid ");
  	echo "<meta http-equiv=Refresh content=0;url=index.php>";
	mysql_close($con);

Thank you...
Posted
Updated 3-Feb-13 18:44pm
v2

1 solution

you can do by using javascript
PHP
<a href="delete_info.php?info=<?php<br mode=" hold=" />echo urlencode($sel_table1['id']);<br mode=" onclick="return confirm('Do you really want to do this?');">Delete Information</a>


seltable is my variable for my table and id is a field.
i hope you will understand this..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900