[thelist] PHP/NN4: Using <?echo $PHP_SELF?> vs. <?$PHP_SELF?>

Ben Phillips ben at inchima.com
Wed Jan 30 10:40:10 CST 2002


> When I use this:
>
> 	<form action="<?$PHP_SELF?>" method="post"...
>

--  <?$PHP_SELF?> is incorrect - that produces nothing.

You should use <?=$PHP_SELF?> or <? echo $PHP_SELF ?>, this produces the
path to the current file.

> I get the effect of having no form action at all in NN4. In fact
> when I view
> source in NN4 using the above PHP, there is not action in the HTML output.
> Seems to have no effect in IE5+.

The reason it doesn't work on some browsers is because they do not action
the form to itself by default, ie. if there is nothing in the action
attribute. Some browsers do.

Benji
inchima.com




More information about the thelist mailing list