HTML - Get data for each button -


i'm trying have login , register button, when login button gets clicked want specify it's login action , when it's register action want specify in url. there sort of attribute define default data in there url (plus input data)?

this current code:

        <form class="login-form" onsubmit="return validate();" method="get" action="php/login.php">             <input class="login-element credential" placeholder="username" id="username" name="username"/>             <button class="login-element button" type="submit">login</button>             <button class="login-element button" type="submit">register</button>         </form> 

<form class="login-form" onsubmit="return validate();" method="get"  action="php/login.php">         <input class="login-element credential" placeholder="username" id="username" name="username"/>         <button class="login-element button" name="login" type="submit">login</button>         <button class="login-element button" name="register" type="submit">register</button>     </form> 

in login.php file code goes this.

       if(isset($_post['login']))        {           //your code goes here...        }    else    {     //your code goes here...    }      if(isset($_post['register']))     {      //your code goes here...     }     else     {       //your code goes here...      } 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

node.js - Using Node without global install -

php - CakePHP HttpSockets send array of paramms -