PHP: Delete from a Database with some prompts from javascript

revolution12345

New Member
My code is below, I am trying to delete records from mysql database but before deleting the browser has to prompt the user whether the deletion should continue. My problem is my logic is not working its deleting the record no matter what. Any help will be appreciated.\[code\] if (isset($_POST['outofqcellchat'])){?><script type ="text/javascript">var question = confirm("Are you sure you want to unsubscribe\nThis will delete all your facebook information in QCell Facebook");if(question){<?php$delusr = mysql_query("delete from `chat_config` where `phone` = '$phonenumb'");$row = mysql_num_rows($delusr);if($row>=1){header("Location:http://apps.facebook.com/qcellchat");}?>alert("Unsubscribed, You can register again any time you wish\nThank You");}else {alert("Thanks for choosing not to unregister \nQCell Expand your world");}</script><?php}?>\[/code\]Thats my code. Please help
 
Back
Top