Stijn Goris wrote:
Is there a way to prevent a refresh of a page?
When a user refreshen on a certain page, pictures he already uploaded, will
upload again...
You could do something like this in your form:
<input type="hidden" name="uniqueid" value="<?PHP echo uniqid(); ?>">
And in your handling code, put something like this:
$file = file("logfile.txt");
//if form has been sent, make the user obtain a new unique id
if (in_array($_POST['uniqueid'], $file)):
echo 'The form has already been sent. Click <a href="foo.php">here</a> to
send again.';
else:
//Process your file uploads as you do now.
//write unique id to logfile
if ($logfile = fopen("logfile.txt", "a")) {
fwrite($logfile, $_POST['uniqueid']);
fclose($logfile);
}
endif;
You'd have to periodically clean out the logfile. You could also use a database
table to do this.
Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com http://www.glassgiant.com