$url is assigned the value of http:// plus the host name (which could be either localhost or www.example.com). To this is added the name of the current directory using the
dirname( ) function, in case the redirection is taking place within a subfolder.
$_SERVER['PHP_SELF'] refers to the current script (which will be the one calling this function), including the directory name. That whole value might be /somedir/page.php. The
dirname( ) function will return just the directory part from that value (i.e., /somedir...
- 12. Cookies and Sessions
- from PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, Fourth Edition
- Publisher: Peachpit Press
- Released: September 2011
LEARN THIS! ! ! ! !
Share this highlighthttp://www.safaribooksonline.com/a/php-and-mysql/5832/