Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP MySQL
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>";
	mysql_close($con);
	

Thank you...
Posted 3-Feb-13 19:35pm
Edited 3-Feb-13 19:44pm
v2

1 solution

Rate this: bad
good
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..
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 434
1 OriginalGriff 380
2 CHill60 240
3 Abhinav S 220
4 CPallini 220
0 Sascha Lefévre 75
1 OriginalGriff 70
2 F-ES Sitecore 55
3 Peter Leow 50
4 Dave Kreskowiak 40


Advertise | Privacy | Mobile
Web03 | 2.8.150327.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2015
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