Click here to Skip to main content
13,451,731 members (49,224 online)
Rate this:
Please Sign up or sign in to vote.
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:
$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>";

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

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

you can do by using javascript
<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..

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04-2016 | 2.8.180318.3 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100