php - Passing variable value to URL -


i want pass variable value url problem when first clicked search button value doesn't appear , when second clicked triggered variable value shown. how can fix this? think fault when click search button page refreshing. can me this?

here's code:

 <div class="form-inline form-padding">                     <form action="student.php?classid=<?php echo $classid;?>" method="post">                         <input type="text" class="form-control" name="search" placeholder="search id or name">                         <select name="subject" class="form-control" required>                             <option value="">select subject...</option>                                                         <?php while($row = mysql_fetch_array($mysubject)): ?>                                 <option value="<?php echo $row['id']?>" <?php if($row['id']==$classid) echo 'selected'; ?>><?php echo $row['subject'];?></option>                             <?php endwhile; ?>                         </select>                         <button type="submit" name="submit" id="submit" class="btn btn-primary"><i class="fa fa-search"></i> search</button>                                                <a href="print.php?classid=<?php echo $classid; ?>" target="_blank"><button type="button" name="submit" class="btn btn-success"><i class="fa fa-print"></i> print</button></a>                                 </form>                 </div> 

enter image description here

in

<form action="student.php?classid=<?php echo $classid;?>" method="post"> 

change to

<form action="student.php" method="post"> 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -