Jump to content


This topic is now archived and is closed to further replies.

mark s

Help - Remove action?

Recommended Posts

Hi i'm really struggeling to find a soloution to my problem.
Ive search PHP FAQ and the headers post but the links are no
longer active to the relevent posts for more info.

What i need to be able to do is remove the last action that
is sent to the address bar to prevent a user error? / Duplicate request
if 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 habbit
makes users use there Browser Refresh button.


Delete record is part of a function which is actioned by clicking
on 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 to
the 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...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.style1 {color: #FFFFFF}
This area has the page layout (HTML)
And the PHP code which uses SWITCH to retreieve the function $GET
switch($_GET['action']) {

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 ?

to this


Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
I see what you mean, But i'm still curious?

For example myphp admin
for 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 on
the 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.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.