Page 1 of 1
$_SERVER['PHP_SELF']; What does it do
Posted: Fri Jun 04, 2004 3:01 pm
by Kingo
Hello,
I just wanted to know what this one ($_SERVER['PHP_SELF']

will do.
Posted: Fri Jun 04, 2004 3:04 pm
by Draco_03
always think about
google or
php.net
but it basically "reload" the same page your in to send information to server so for exemple when you filla form instead of loading another ppage it load the same one wqith the mistake in red next to the badly entered field.
Posted: Fri Jun 04, 2004 9:50 pm
by evilmonkey
Alternatively, you can pass parameteres through the address bar. For instance, if a page loads and finds a cookie on a user's machine, you can refresh the page to something like $_SERVER[PHP_SELF]?login=1&sessid={SESS_ID}. Stuff like that. Basically, it saves you writing index.php or pagename.php and allows you to put the above line in an include file and use it throughout your site. Hope that helped!
Good luck!
Posted: Fri Jun 04, 2004 10:28 pm
by d3ad1ysp0rk
Draco_03 wrote:always think about
google or
php.net
but it basically "reload" the same page your in to send information to server so for exemple when you filla form instead of loading another ppage it load the same one wqith the mistake in red next to the badly entered field.
No it doesn't.
It's a part of an array ($_SERVER array) that contains the value of the current page name (ie. default.php). Nothing more, nothing less.
Posted: Sat Jun 05, 2004 2:39 am
by mudkicker
just a variable to help you to get the current page name. By the way, lilpunk that link in your sig helped me soo much thanks

Posted: Sat Jun 05, 2004 9:03 am
by d3ad1ysp0rk
Glad to hear it mudkicker, I hoped making it would help at least a few people, and I've gotten around 130 unique hits, so I guess it has.

Posted: Sun Jun 06, 2004 3:48 am
by mudkicker

well, it helped cos i got stuck on some point by installation. and it guided me very good. At least it helped me
