That's what I figured ... so why the 'h' doesn't it work??????????!!!!!!!!!!!!
redirect after processing
Since you already have html tags... would Javascript be as suitable solution?
<script>
document.location = 'nextpage.php';
</script>
Just a suggestion...
well, i see now...
small introduction to swissgerman:
Murks [read moorks in english]: solution which works but is not proper
my murks to solve your problem:
<?
session_start();
$checkok='';
/IF INPUT TO PROCESS AND NOT SESS_PROCESSED==TRUE{ /
//Check input
//set SESSION_PROCESSED=TRUE
/ } /
if($checkok=='OK'){
include('answer.php');
}
else{
include('form.php');
}
?>
I hate to say this but redirection is not going to solve the reprocessing problem. It will just move the problem to the browsers back button. This is not a good solution since the back button is used much more often than the reload button.
To stop the reprocessing of information requires a check. This means you actually have to look to see if you've already processed the information once. If so then don't process it again.
<?
$check=0;
/Run your check on the information. If you've already processed it set $check=1 /
checkinfo();
if (!$check){
include(processinfo.php);
}
?>
This will mean that you will need some way of determining whether the information has been processed before or not.
[deleted]
Actually, one of the biggest problems of double-postings is that people are impatient and press reload after pressing submit, even before the reply page is complete.
that is the real problem.
There aren't many people who willingly use the back-button to go back and post the same thing again.
This solution is not 100% proof, but it catches about 90% of all double posts.
[deleted]
No, because javascript doesn't run untill the page is loaded, which is too late, and javascript is not reliable (people can switch it off)
[deleted]
Well what the "F" does the "F"ing code look like?
hey, this one-letter cursing is catchy :-)
header("Location: $target_url");
where $target_url is where you want to go. This statement can occur after any processing you want to do in your script but must be placed BEFORE any output is made. I'm told php4 is a bit more forgiving about output sent before this function, but I've never wanted to test it.
This will allow one script to execute and then redirect to another page/script. I've used it several times without issue.
I totally failed to see your original snippit about the header function not working.
I'm with the other poster who recommended cleaning up the code so the function works. I've used this technique several times in several situations without issue.
If you want to redirect, and you cant rely on the PHP header function or Javascript...theres always HTML!!!
Just insert this at the bottom of your script (or wherever really):
//end of script
?>
<head>
<META HTTP-EQUIV="refresh" CONTENT="0;URL=http://www.yahoo.com">
<title>Processing...please wait</title>
</head>
That redirects the user to http://www.yahoo.com
If you want to redirect them back to where they came from after processing the info (say if you are using a shoutbox), use this:
<head>
<META HTTP-EQUIV="refresh" CONTENT="0;URL=<? print("$HTTP_REFERER"); ?>">
<title>SHOUTBOX M.E. REDIRECTING</title>
</head>
All done
If you want to redirect, and you cant rely on the PHP header function or Javascript...theres always HTML!!!
Just insert this at the bottom of your script (or wherever really):
//end of script
?>
<head>
<META HTTP-EQUIV="refresh" CONTENT="0;URL=http://www.yahoo.com">
<title>Processing...please wait</title>
</head>
That redirects the user to http://www.yahoo.com
If you want to redirect them back to where they came from after processing the info (say if you are using a shoutbox), use this:
<head>
<META HTTP-EQUIV="refresh" CONTENT="0;URL=<? print("$HTTP_REFERER"); ?>">
<title>SHOUTBOX M.E. REDIRECTING</title>
</head>
All done
[deleted]
Seeing I have tried all suggestions below and still can't get this thing to work the way I want it to (and I must admit I'm probably wanting <too> much) ... I'll go back on the original advice: CLEAN UP THE "F" CODE ........
Thanx anywayz!
Could something like this be helpful?
header ("Cache-Control: no-cache, must-revalidate");
albin
What you all want is a function that I use, and it work's perfectly good. Try this:
<?
echo "<script language='javascript'>document.location.href='yoursite.php';</script>";
?>
And that row is simply added to whenever you wish to be forwarded, like after a submit or whatever your problem was.
Make a function out of it, like:
function GoTo($page) {
echo "<script language='javascript'>document.location.href='$page';</script>";
}
[deleted]
sigh
No Richard, that's not the real answer, because javascript can be disabled by the client.
god be Damned. OK, I never really thought of that, so I'll leave this topic entirely.
[deleted]
No need to leave it completely, all ideas are welcome!
It's just that this particular one was not very strong :-)
No offence to you Richard
Haha, it's allright. I took no offence. However, I am used to that my users have JavaScript enabled.
- Richard
// don't I have an account here? Nevermind.