How to set self page in form action?

In PHP some developer use same page for code and some use separate page for code of PHP script.so who use same page to script, they set page path in form tag as action.for that not set every time path of page use common code to put path of page.


htmlspecialchars($_SERVER["PHP_SELF"]); 


This code put in action attribute of form tag. this get current page path directly.


For ex.

<form name="test"  action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post" > 

                  //Your code

</from>

Comments

Popular posts from this blog

Let's make a webservice in php