View Full Version : php_self

04-15-2003, 03:00 PM

lets say I have a url www.testing.net/hello/testing.php

when I use php_self as a link
<a href="<?php echo"$PHP_SELF"; ?>">dont work</a>
It will go to www.testing.net/hello/
but it doesn't include the file name. what happen to testing.php when using $PHP_SELF? :(
(I also tried $_SERVER[PHP_SELF], didn't work) :(

When I use $PHP_SELF in a form
<form action=<?php echo"$PHP_SELF"; ?> method=POST>
with form, it will work perfect... :)

<a href="<?php echo "$PHP_SELF?test=69" ?>">works</a>
it will works too..:)

Can someone tell me why?

Thank you all


04-15-2003, 05:00 PM
Well the proper way would be:

<a href="<?php echo $_SERVER["PHP_SELF"]; ?>">

<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method=POST>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum