I want the form action to be decided based on whether a check box has been selected or not using php -


if check box below selected want form processed teacherprocess.php , if checkbox not selected want form processed process.php. i'd rather done using php know people not support javascript in browsers.

<form class="form-horizontal" action="#" method="post" name="form">  <div class="control-group">  <input class="input-block-level" type="text" id="username" name="username" placeholder="username">  </div>  <div class="control-group">       <input class="input-block-level" type="password" name="password" id="inputpassword" placeholder="password">     </div> <input type="checkbox" name="teacher" value="i teacher"> <input type="submit" name="submit2" value="student"  class="btn btn-info"> </form> 

send form intermediate php page:

<form class="form-horizontal" action="selector.php" method="post" name="form"> 

then decide, based upon checkbox being checked, page execute:

<?php // selector.php  if (isset($_post['teacher'])) {      require ('teacherprocess.php'); } else {      require ('process.php'); } 

disclaimer: didn't try that.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -