$PHP_SELF is a php's internal variable and gives the url's name. So with that you can always call the same form, where you just gives the command. Otherwise it will call index files. So your php form script is example.php which includes also the form and add buttom and so on. With that $PHP_SELF in action, you call the example.php again. And now the variable $insert="add". More information from internal variable you can find from php.net.