echo $_SERVER["PHP_SELF"] code example Example: php self <form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >