Method #1: Database
Create a database with a table with one int field called text_counter
In your script, read the value of that field, increment the number, write the new number to the database
then in your script, you say: $filelocation = "texte" . $number . ".txt";
If you choose this method, there are lots of tutorials on the Internet for creating tables in MySQL databases and reading / writing the table from PHP.
Method #2: Storing the counter in a text file
Write a text file called text_counter.txt with a number in it.
Chmod 777 the file so that it's writeable.
In your script, read the text file, increment the number, write the new number to the text file
then in your script, you say: $filelocation = "texte" . $number . ".txt";
If you choose this method, there are lots of tutorials to show you how to use fopen to read and write text files.
The first method is just a good skill to have - you'll find a trillion uses for databases but it's going to keep you busy for a few days as you learn the database thing. The second method is simple (especially since you're already writing text files) but the skill is less valuable in the long run because you're going to find it's hard to seach text files as your needs get more complicated over time.