mark s Posted June 13, 2006 Share Posted June 13, 2006 Hi i'm really struggeling to find a soloution to my problem.Ive search PHP FAQ and the headers post but the links are nolonger active to the relevent posts for more info.What i need to be able to do is remove the last action thatis sent to the address bar to prevent a user error? / Duplicate requestif the end user uses the Refresh button in there browser.Or is it okay leaving it displayed?I created a refresh button on my page, but habbitmakes users use there Browser Refresh button.Exampleindex.php5?action=delete_recordDelete record is part of a function which is actioned by clickingon a link "Delete Record"which access my database and then deletes the record.What i would like to achive if possible is to be able to return tothe same page but only index.php5 in the address bar.As the delete record changes the results in my displayed table.I have been trying for a while to get this result with out any luck.Ive read that the Header() must be the first thing at the top of my page.And i tried placing the Header (http://www.***/index.php5)But it seemed to go into a loop and my page wouldnt update?Ive covered the "White spaces" as a possible issue.So i get the idea how important it is the have the Header()at the top of the page but i cant get it to work?----My page displays a database results with diffrent options attached to functions.Enter / Delete /My page code...[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>SPAM</title><style type="text/css"><!--.style1 {color: #FFFFFF}--></style></head><body>This area has the page layout (HTML)And the PHP code which uses SWITCH to retreieve the function $GETswitch($_GET['action']) {</body></html>[/code]---------------------------Can anyone point me the right direction please.?How if possible could i include the Header() in each function,to prevent that last action being displayed?I looked up ob_start but got more lost.and decided to post for opinions and help.Do i have to wrong approach?What could / should i do ?index.php5?action=delete_recordto thisindex.php5Help Quote Link to comment https://forums.phpfreaks.com/topic/11867-help-remove-action/ Share on other sites More sharing options...
ober Posted June 13, 2006 Share Posted June 13, 2006 The best way to avoid these errors is to submit to a "middle page". Your form submits to a secondary page that performs the processing and then uses a header() call to redirect back to the starting page or onto the thank you page or wherever you want to go.That's the only true way to avoid this problem. Quote Link to comment https://forums.phpfreaks.com/topic/11867-help-remove-action/#findComment-45043 Share on other sites More sharing options...
mark s Posted June 13, 2006 Author Share Posted June 13, 2006 I see what you mean, But i'm still curious?For example myphp adminfor controling your databases.When working in php admin control panel,it works the way i would love to be able to reproduce.You can see the Actions / requests being done,but in the staus bar only.The top address bar remains static.You can sort the contents accending or disacending if you click onthe colom name at the top of your table in browse mode.So its not a "Button" it is a link.I know it looks like a frame to the left listing your DB Tables.Does Php Admin use java script or do they just have it sussed?Can anyone enlighten me please,as i'm sure many could benifit from advice given.Thanks in advance mark. Quote Link to comment https://forums.phpfreaks.com/topic/11867-help-remove-action/#findComment-45188 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.