pouncer Posted January 24, 2007 Share Posted January 24, 2007 [code]<?php if (isset($_POST['Submit_x'])) { $message_id = $_POST['message_id']; echo "the delete was clicked on messageid: " . $message_id; //delete that message with $message_id - I can do this, no problem //refresh the page so that the table will have 1 less entry - how do i refresh? }?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/35520-php-refreshing-page-after-deleting-a-sql-entry/ Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 Don't echo anything out, and use header('Location: phppage.php'); Quote Link to comment https://forums.phpfreaks.com/topic/35520-php-refreshing-page-after-deleting-a-sql-entry/#findComment-168129 Share on other sites More sharing options...
pouncer Posted January 24, 2007 Author Share Posted January 24, 2007 thanks for the reply jes!I'm getting some errors, i just did this to test[code] <?php if (isset($_POST['Submit_x'])) { $message_id = $_POST['message_id']; header('Location: $PHP_SELF'); } ?>[/code]Warning: Cannot modify header information - headers already sent by (output started at c:\domains\interzurf.nl\wwwroot\socialnetwork\member\myprivatemessages.php:106) in c:\domains\interzurf.nl\wwwroot\socialnetwork\member\myprivatemessages.php on line 169 Quote Link to comment https://forums.phpfreaks.com/topic/35520-php-refreshing-page-after-deleting-a-sql-entry/#findComment-168140 Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 Then you must be outputting something to the page before then. What is on line 106?Read the topic on header errors too. Quote Link to comment https://forums.phpfreaks.com/topic/35520-php-refreshing-page-after-deleting-a-sql-entry/#findComment-168146 Share on other sites More sharing options...
pouncer Posted January 24, 2007 Author Share Posted January 24, 2007 Ok. hmm the line 106 is<td width="50%"><div align="right"><span class="style74"><a href="member.php">Member home</a> | <a href="myprofile.php">My profile</a> | <a href="jkj">My collections</a> | <a href="myprivatemessages.php">My private messages</a> </span></div></td> Quote Link to comment https://forums.phpfreaks.com/topic/35520-php-refreshing-page-after-deleting-a-sql-entry/#findComment-168149 Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 You can't output anything to the screen. If you want to be able to reload the page, you should do all your processing before you ever output anything, any HTML, anything. Quote Link to comment https://forums.phpfreaks.com/topic/35520-php-refreshing-page-after-deleting-a-sql-entry/#findComment-168152 Share on other sites More sharing options...
pouncer Posted January 24, 2007 Author Share Posted January 24, 2007 hmm ok thanks jess. will it work if i put a timer on the reload? Quote Link to comment https://forums.phpfreaks.com/topic/35520-php-refreshing-page-after-deleting-a-sql-entry/#findComment-168156 Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 If you want to use the meta refresh tag, that will work for most people. Quote Link to comment https://forums.phpfreaks.com/topic/35520-php-refreshing-page-after-deleting-a-sql-entry/#findComment-168161 Share on other sites More sharing options...
pouncer Posted January 24, 2007 Author Share Posted January 24, 2007 yeahh this worked[code]<?php if (isset($_POST['Submit_x'])) { $message_id = $_POST['message_id']; echo "to delete: " . $message_id; echo "<meta http-equiv=\"refresh\" content=\"4; url=myprivatemessages.php\" />"; }?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/35520-php-refreshing-page-after-deleting-a-sql-entry/#findComment-168165 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.