Page 1 of 1

$_SERVER

Posted: Fri Aug 20, 2004 10:49 am
by Haku
Hi,

What is the difference in the behaviour of the php code below:
(Assume the current page is reload.php and by reloading the page, we want to update certain values)

Code: Select all

<form action = "<?=$_SERVER['PHP_SELF']?> method = "post">
and

<form action = "reload.php" method = "post">

Thank you very much,
-Haku-

Posted: Fri Aug 20, 2004 10:53 am
by lostboy
the first is simply more adaptable. if you change the location of the page, you don't need to edit the code to change the path...

Posted: Fri Aug 20, 2004 5:53 pm
by William
Ya, Makes it really nice specially if your including the file .ect

Posted: Fri Aug 20, 2004 9:21 pm
by m3mn0n
Yes either that or use a central const.php file that stores the location of the processing pages. So if indeed you move your site, you can edit the central constant variable file and all is well again.