$_SERVER(PHP_SELF) - question
Posted: Mon Aug 20, 2007 1:01 am
a newbie question, i've searched and tried other php functions but can't resolve this
i have 3 files, index.php, list.php and form.php
my site is basically a comments page, my index.php shows list.php(previous comments) and form.php(form to input comment)
first file is index.php
script inside calls list.php and form.php via include
inside list.php i used the script $_SERVER(PHP_SELF)
when i load the index.php
the value of $_SERVER(PHP_SELF) -- i used an echo $_SERVER(PHP_SELF) in line 2 of list.php
is "mysite.com/index.php"
but when i clicked on form.php, i have a submit button here to input comment.
and the value of $_SERVER(PHP_SELF) changed "mysite.com/list.php"
*** when i clicked on the submit button the url is still "mysite.com/index.php"
when I refresh the page the value changes again to "mysite.com/index.php"
is there a way for me to get "mysite.com/index.php" by not hard coding the value?
Thanks in Advance

i have 3 files, index.php, list.php and form.php
my site is basically a comments page, my index.php shows list.php(previous comments) and form.php(form to input comment)
first file is index.php
script inside calls list.php and form.php via include
inside list.php i used the script $_SERVER(PHP_SELF)
when i load the index.php
the value of $_SERVER(PHP_SELF) -- i used an echo $_SERVER(PHP_SELF) in line 2 of list.php
is "mysite.com/index.php"
but when i clicked on form.php, i have a submit button here to input comment.
and the value of $_SERVER(PHP_SELF) changed "mysite.com/list.php"
*** when i clicked on the submit button the url is still "mysite.com/index.php"
when I refresh the page the value changes again to "mysite.com/index.php"
is there a way for me to get "mysite.com/index.php" by not hard coding the value?
Thanks in Advance