That wouldn't work because that variable is not persistent. Some alternatives to store this var across requests could be:
Use the $_SESSION global var to store the number of times your form has been submitted:
(Here I'm assuming your form uses POST as requesting method, and your submit button id is "submit")
if( $SERVER['REQUEST_METHOD'] == 'POST' && !empty( $_POST['submit'] ) ){ // //deal with your form action here // //Here's the bit where you store/update your counter if( !isset( $_SESSION['submitted'] ){ $_SESSION['submitted'] = 1; else { $_SESSION['submitted']++; } //Echo your counter echo "This form has been submitted " . $_SESSION['submitted'] . " time(s)"; }
Use a hidden field in the form to store your counter. Check this answer hidden field in php
Hope it helps