Keeping track
Posted: Tue Oct 07, 2008 1:11 am
I've never written my own php i just started looking at php this past week and it looks similar to basic. So...I have a form on a page and is submitting to threw a php page i want the php page to number each submission so i created a txt file called "number" that text file only has a 0 in it. I think i wrote this code below so that it opens the text file reads the 0 adds one to it and then saves and closes it. If this code is correct for that then the only question i have is how do i call it back so i can reference it back on the form page to say the number that has been submitted? I'm gonna change the page to a php cause i can display html and css in that page the same correct?
Thanks for any suggestions you have.
Code: Select all
<?php
$num = "number.txt";
$increase = fopen($num, 'w');
$val = ($num + 1);
fwrite($increase, $val);
fclose($increase);
?>