Jump to content

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.

Example
index.php5?action=delete_record

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...
[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 $GET
switch($_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_record
to this
index.php5

Help
Link to comment
https://forums.phpfreaks.com/topic/11867-help-remove-action/
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.
Link to comment
https://forums.phpfreaks.com/topic/11867-help-remove-action/#findComment-45043
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.
Link to comment
https://forums.phpfreaks.com/topic/11867-help-remove-action/#findComment-45188
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.