Jump to content


Photo

Help - Remove action?


  • Please log in to reply
2 replies to this topic

#1 mark s

mark s
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 13 June 2006 - 02:02 PM

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...
<!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>

---------------------------
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

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 13 June 2006 - 02:44 PM

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.

Info: PHP Manual


#3 mark s

mark s
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 13 June 2006 - 07:49 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users