shanthi Posted May 31, 2010 Share Posted May 31, 2010 hi, I have written php code for deleting perticular row its working but i need to confirm before deleting Please assist.... Link to comment https://forums.phpfreaks.com/topic/203403-confirming-before-deleting-a-row-from-database/ Share on other sites More sharing options...
riwan Posted May 31, 2010 Share Posted May 31, 2010 I would think of javascript solution <input type="Submit" value="Delete" onclick="return confirm('are you sure ?');"/> Link to comment https://forums.phpfreaks.com/topic/203403-confirming-before-deleting-a-row-from-database/#findComment-1065562 Share on other sites More sharing options...
shanthi Posted May 31, 2010 Author Share Posted May 31, 2010 i am using an image not button and i need the complete java script code Link to comment https://forums.phpfreaks.com/topic/203403-confirming-before-deleting-a-row-from-database/#findComment-1065568 Share on other sites More sharing options...
riwan Posted May 31, 2010 Share Posted May 31, 2010 well, its because you don't give any of your source code. you could use sth like <a .... onclick="return confirm('are you sure ?');"><img .../></a> Link to comment https://forums.phpfreaks.com/topic/203403-confirming-before-deleting-a-row-from-database/#findComment-1065571 Share on other sites More sharing options...
shanthi Posted May 31, 2010 Author Share Posted May 31, 2010 I have done the same i got the error message syntax error, unexpected T_STRING, expecting ',' or ';' i am forwarding my code please assist [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/203403-confirming-before-deleting-a-row-from-database/#findComment-1065574 Share on other sites More sharing options...
riwan Posted May 31, 2010 Share Posted May 31, 2010 This is why you should give your code. You're using html in php. Below should work echo'<a href="deleteEmployeenew.php?id='.$rs[0].'" onclick="return confirm(\'are you sure ?\');">'; Link to comment https://forums.phpfreaks.com/topic/203403-confirming-before-deleting-a-row-from-database/#findComment-1065578 Share on other sites More sharing options...
shanthi Posted May 31, 2010 Author Share Posted May 31, 2010 Thank you its working Link to comment https://forums.phpfreaks.com/topic/203403-confirming-before-deleting-a-row-from-database/#findComment-1065581 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.