Possible Duplicate:
PHP script not working in HTML file
I have this:
<?php
if(isset($_POST['submit'])){
$f = fopen('counter.txt', 'r+');
flock($f, LOCK_EX);
$total = (int) fread($f, max(1, filesize('counter.txt')));
if (isset($_POST['submit'])) {
rewind($f);
fwrite($f, ++$total);
}
fclose($f);
}
?>
AND it works in the txt file. It counts correctly the clicks. BUT this:
Times submited <?php echo $total; ?>.
doesn't work in my index.html file where I have my form. Please can you help?
This the line of my files:
- form (index.html)
- a .php file
- header("Location: thankyou.php")
- then back to index.html