troubleshooting Question

How to save fields form

Avatar of team2005
team2005 asked on
HTMLPHP
16 Comments1 Solution425 ViewsLast Modified:
Hi!

Have this form :


<form class="formqueryform" action="<?php $_PHP_SELF ?>" method="POST">
    <table width="100%" align="left" class="formsql">
	
	<tr class="blank_row_noborder">
      <td colspan="3"></td>
    </tr>

	<tr class="blank_row_noborder">
      <td colspan="3"></td>
    </tr>	
	
	<tr>
        <td  class="rapport1_del3" align="right" valign="top">Dato:</td>
		<td align="left" valign="top">
		   <input type="date" name="date1" id="date" value=<?php echo $dagensdatopast ?> class="formreports" /> 
           <input type="date" name="date2" id="date2" value=<?php echo $dagensdato ?> class="formreports" /> 
		   <label for="Scale" class="form-radio"><input type="checkbox" name="datobrukes" class="formreportsdate" id="datobrukes" checked> Dato</label>
		</td>
	</tr>
	<tr>
	<td  class="rapport1_del3" align="right" valign="top">Kontroller:</td>
	<td  class="rapport1_del3" align="left" valign="top">
  	  <select id="recipient" name="kontroller" tabindex="6" class="selmenu">
  						<option>Alle kontrollere</option>
                  <?php
                     $result3 = mysql_query("SELECT Navn FROM {$table1} WHERE Bruker_id='{$brukerID}' and Kunde_id='{$kundeid}'") or die(mysql_error());
                     while ($row3 = mysql_fetch_array($result3)){
                        $navnkon = $row3['Navn'];
?>
                        <option><?php echo $navnkon; ?></option>
	  
<?php
}
?>		
</select>
	</td>
	</tr>

	<tr>
	<td  class="rapport1_del3" align="right" valign="top">Bruker:</td>
	<td  class="rapport1_del3" align="left" valign="top">
  	  <select id="recipient" name="brukere" tabindex="6" class="selmenu">
  						<option>Alle brukere</option>
                  <?php
                     $result3 = mysql_query("SELECT Navn FROM {$table2} WHERE Kunde_id='{$kundeid}'") or die(mysql_error());
                     while ($row3 = mysql_fetch_array($result3)){
                        $navnbruker = $row3['Navn'];
?>
                        <option><?php echo $navnbruker; ?></option>
	  
<?php
}
?>		
	  </select>
	</td>
	</tr>
	<tr>
    <td  class="rapport1_del3" align="right" valign="top">Svar:</td>
    <td>
        <label for="Alle" class="form-radio"><input type="radio" value="0" name="svar" id="Alle" checked> Alle</label>
        <label for="Ja" class="form-radio"><input type="radio" value="1" name="svar" id="Ja"> Ja</label>
		<label for="Nei" class="form-radio"><input type="radio" value="2" name="svar" id="Nei"> Nei</label>
		<label for="Scale" class="form-radio"><input type="radio" value="3" name="svar" id="Scale"> Scale</label>
    </td>
	</tr>
	
	<tr>
	   <td  class="rapport1_del3" align="right" valign="top">Rapport:</td>
	   <td>
	    <label for="Rapport 1" class="form-radio"><input type="radio" name="rapport" value="1" id="Alle" checked>Rapport 1</label>
        <label for="Rapport 2" class="form-radio"><input type="radio" name="rapport" value="2" id="Ja">Rapport 2</label>
	   </td>
	</tr>
	
	<tr>
	<td class="rapport1_del4" align="right" valign="top">S</td>
	<td>
	<section id="buttons">
			<!--<input type="reset" name="reset" id="resetbtn" class="resetbtn" value="Reset"> -->
			<input type="submit" name="submit" id="submitbtn" class="submitbtn" tabindex="7" value="Soke">
			<br style="clear:both;">
		</section>
	</td>
	</tr>
	
	<tr class="blank_row_noborder">
      <td colspan="3"></td>
    </tr>	
	
	<tr class="blank_row_noborder">
      <td colspan="3"></td>
    </tr>	
   
   </table>
	</form>  

I use this form o a webpage (php), and show the result from the selections.

My problem is that a query is executed, every time the same page is loaded.

I need a way to store the selected values from the form.
So the next time the page is loaded, it show the user the same selected values.

How can i do this ?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 16 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros