tags:

views:

28

answers:

3

I am trying to send over a page number to a page using a html form. The problem is every-time the form is submitted, it overwrites the page GET value, with all the other GET values being sent over from the form.

the form is below

<form action="searchPage.php?page=0" method="get">
<label for="search" id="searchLabel">Search:</label>
<input type="text" size="30" name="search" id ="search" value="<?php echo $_GET['search'] ?>" />
<label for="XML" id="XMLLabel">XML</label>
<input type="checkbox" name="XML" value="Xml" />
<input type="submit" value="Search" name="searchButton" id="searchButton" /> 
<input type="submit" value="Browse" name="browseButton" id="browseButton" /> 
+1  A: 

Change

<form action="searchPage.php?page=0" method="get">

to

<form action="searchPage.php" method="get">
   <input type="hidden" name="page" value="0">
David
+1  A: 

I think you need to use a hidden input field to pass the page number.

<input type="hidden" name="page" value="0"/>
Todd
+1  A: 

You can add a hidden element on the form with the value.

  <input type="hidden" name="page" value="<?php echo $_GET['page'] ?>" />

This way the user does not see the value but it is sent every time.

Vincent Ramdhanie