Solved

HTTP_POST_VARS and refreshing page

Posted on 2003-12-02
6
395 Views
Last Modified: 2008-03-06
Is there a way to capture POST values if the refresh button is pressed?

sorry for the low points, all I have
0
Comment
Question by:zanner
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:aolXFT
ID: 9859727
Usually the Browser will ask the user wants to resend the POST variables.

If not, then you could store them in a session, and retrieve them from the session later.
0
 
LVL 1

Expert Comment

by:Snyke
ID: 9860364
I think sessions are the easiest way to do it.
Or if the values aren't so much you could use cookies, but all this relies on the fact that the user accepts cookies (since even Sessions use cookies if not used through the URI).
0
 
LVL 6

Expert Comment

by:aolXFT
ID: 9860485
Well with Sessions you can transmit the id with --enable-trans-id through GET or POST links. Having that said that would be using the solution to solve your problem without actually coming up with the solution(or something like that).

I think we need more information before we can make any real suggestions regarding the circumstances surrounding the situation.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:zanner
ID: 9861232
attempting to use session variable

this is what i want to accomplish

// top of page

session_start();

if ($_SESSION["state"] != "true") {
     $_SESSION["state"] = "false";
     session_register('state');
}

// assign new value if db query successful

$_SESSION["state"] = "true";
session_register('state');

// test if db query not successful

if ($_SESSION["state"] == "true") {
     do stuff
} else {
     do other stuff
}

this is all done on one page

thanks!


0
 
LVL 6

Expert Comment

by:aolXFT
ID: 9861327
You don't have to use session_register if you are using the $_SESSION array.
0
 
LVL 1

Accepted Solution

by:
Snyke earned 30 total points
ID: 9861784
How about using this:

<?php
  foreach($_POST as $key => $value)
    $_SESSION["posted_".$key] = $value; //the prefix is just to be sure no important variable is overwritten.
?>
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PHP and Soap 3 27
put variable in sql statement  php 3 27
Setting Up Local Lan Web Server 1 14
php connect() failed error 25 13
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now