How and where can i declare a variable that is initialized to the value "1" only once ever and gets incremented always.
If you have a file that is included at the top of each page like a counter or database connection file you could stick it in there.
Is it a counter? If yes check out my tutorial. counter script tutorials http://www.phpeasystep.com/workshopview.php?id=7
Himambo, that is exactly what i need. I've followed the tutorial, however, i keep getting the following error: Access denied for user 'ODBC'@'localhost' (using password: NO)
Are username, password and host correct? By the way, you should be aware that this script won't count actual visitors, just hits on page. If a visitor chooses to load a page several times, that would register as individual hits as well.
Yes username, password and host are correct. Actually i didnt realize the refresh would also increment the counter. I have a button called "Create" which causes a form to be filled out. Upon completion of the form, the user submits. I need to associate a unique number for every new 'creation'. does that make sense?
Absolutely Do you submit the contents of the form to a mysql database? If so, you could just add an ID column with auto increment and save yourself the work of doing it in php.
Actually I got it to work. It was my bad, i had named the insert field wrong when trying to write to the database. This works fine with what i'm trying to accomplish. The numbers may bot always be sequential, depending on refreshing the page, but as long as they unique, i'm good. Thanks for all your help guys.
To throw out another tip that wouldn't be too much extra code - you could check the ip address or referer page to check for dups or bots...