devilinc Posted November 26, 2010 Share Posted November 26, 2010 i have a script which deletes users and if user is deleted it just prints A message saying user is removed but, even if i refresh the page after that the message still remains.....what do i do? if(isset($_GET['user_delete']) && isset($_GET['module_delete'])){ $user_delete = $_GET['user_delete']; $module_delete = $_GET['module_delete']; $query = mysql_query("DELETE FROM module_assign WHERE module_assign.user_id = $user_delete AND module_assign.module_id = $module_delete"); //header( 'refresh: 3; url=admin.php' ); echo "<font color ='red'>User has been unassigned</font>"; } there is no point in doing the header redirect(i cant do it as headers already send it seems) because even if the page refreshes manually, my message doesnt go off....what do i do? Quote Link to comment https://forums.phpfreaks.com/topic/219895-remove-a-message-printed-on-screen/ Share on other sites More sharing options...
revraz Posted November 26, 2010 Share Posted November 26, 2010 Only show the message when something is actually deleted? Quote Link to comment https://forums.phpfreaks.com/topic/219895-remove-a-message-printed-on-screen/#findComment-1139905 Share on other sites More sharing options...
MrXHellboy Posted November 26, 2010 Share Posted November 26, 2010 if ($query) { // Code here } Quote Link to comment https://forums.phpfreaks.com/topic/219895-remove-a-message-printed-on-screen/#findComment-1139906 Share on other sites More sharing options...
devilinc Posted November 26, 2010 Author Share Posted November 26, 2010 what i have done is given a link next to my message when clicked redirects the user to the page i intend to go....(which is $_SERVER['PHP_SELF'] ofcourse) Quote Link to comment https://forums.phpfreaks.com/topic/219895-remove-a-message-printed-on-screen/#findComment-1139908 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.