Azhar,
$PHP_SELF (not $php_self.... it's case sensitive) is not a function, it's a special PHP environment variable which always contains the relative path for the current file.
You're not wrong to place to actions in a separate file. You're not wrong to place your actions in the same file as the form. It's really just a matter of personal preference, code readabilty/maintainablity, and functionality. The circumstances in each case will be different so what's best for one, may not be best for all.
Using $PHP_SELF as a form's action is the same as any other action target in PHP. The form is submited, the server processes the request, sends the html output, and the browser displays it. What the server does and returns to the browser is entirely up to your code.
HTH.
Geoff A. Virgo