$_SERVER['PHP_SELF'] -> usefulness?
Posted: Wed Nov 22, 2006 11:41 am
tutorials insist on using this when assigning the action attribute to a form tag, ie:
from what i understand, all this does is return the url from the document root up. ie: using the code on http://www.kosta.com/foo/login.php would just give /foo/login.php
but now i ask, what's the point?
using the code below works perfectly fine:
all i want is to call the same file that the script is in so why all the fancy superglobal code?
i hope this isn't a silly question. my gut thinks it is.
Code: Select all
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" etc.but now i ask, what's the point?
using the code below works perfectly fine:
Code: Select all
<form action="login.php"i hope this isn't a silly question. my gut thinks it is.