Page 1 of 1

Php_self ?

Posted: Wed Nov 26, 2003 2:42 pm
by msaf101
If my form uses the action $php_self, and the php code is found elsewhere on the page, how does the form know what php code to use? This would be really confusing on pages where I have several independant bits of php code, like if part of the form itself (For an input field label that could change or something) contained php code.

Despite my inexperience I think I've already decided that my forms should call on specific php files rather than code on the same page.

Posted: Wed Nov 26, 2003 2:54 pm
by microthick
It'll execute the code from the top of the page to the bottom.

To use specific code, you could add a hidden form field like:
<input type="hidden" name="action" value="update">

Then have in php an if block to check what "action" you should perform.