0

Hello,

I read an article on "how to prevent users from submitting a form twice." at the url http://www.4guysfromrolla.com/webtech/100406-1.shtml

I was able to freeze the web page but was not able to unfreeze the web page. I am using PHP with javascript. Nothing happens when my code executes the "unfreeze" js function. I tested this js function and it only worked after I disabled the 2 php header() functions below. The JS unfreeze function just stops working with the php header functions enabled. There were no errors. Only the web page still freezes.

I hope someone can give me advice to help me solve this issue. Thanks in advance.

Below is my code in short version:

<?php
ob_start();

$hearingform = '
<html>
<head>

<style type="text/css">
.....
</style>

<div align="center" id="FreezePane" class="FreezePaneOff">
<div id="InnerFreezePane" class="InnerFreezePane"> </div>
</div>

<script type="text/javascript">

function FreezeScreen(msg) {
scroll(0,0);
var outerPane = document.getElementById("FreezePane");
var innerPane = document.getElementById("InnerFreezePane");
if (outerPane) outerPane.className = "FreezePaneOn";
if (innerPane) innerPane.innerHTML = msg;
}

function unFreezeScreen() {
var outerPane = document.getElementById("FreezePane");
outerPane.className = "FreezePaneOff";
}';

//---------------------------------------------------------
// some code to pull data from the database here...
//---------------------------------------------------------

// unfreeze the webpage
echo '<script type="text/javascript">unFreezeScreen();</script>';

/*send data to an excel file*/
header("Content-type: application/csv");
header("Content-Disposition: attachment; filename=$filename");

echo $data;

exit;
} //END post IF

print $hearingform;

ob_flush();
?> 
3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by lambing
0

It's not clear, is this a script that composes the page with the form on it or a script that's executed in response to the form being submitted?

Much of the code indicates the one and the rest indicates the other.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.