tags:

views:

34

answers:

1

I have two hidden fields in the form (php) where these hidden fields are being replaced These hidden fields have the value from two text boxes. So we are getting the values directly from the textboxes in the action form

<input type ="text1" name="text1" value="">
<input type ="text2" name="text2" value="">

<?php

if(!empty($_POST['text1'])){
    $fromvalue ="somevalue";
}else{
   $fromvalue ="somevalue";
}

if(!empty($_POST['text2'])){
    $tovalue ="somevalue";
}else{
    $tovalue ="somevalue";
}

?>

How do we Replace with the Hidden fields posted values in PHP

So My problem is I have a Pagination Available when clicking the "next" button $fromvalue and $toValue becomes null because we are not posting the "fromvalue" and "tovalue" again and my query is not executed

How Do i capture the Value in the textboxes and put in the below code so that my query gets executed

Query generated From the below

if(strlen($fromValue) == 4){
        $qry .= " and CVDT >= $fromvalue";
    }

if(strlen($tovalue) == 4){
        $qry .= " and CVDT <= $tovalue";
    }
A: 

If you submit a form any inputs of type="hidden" get submitted too, as long as they have their name field set. You should be able to access the values in whatever page you're submitting to exactly the way you show: $_POST['inputName']

Alex Zylman
FYI Iam Not using HIdden fields and I should get rid of hidden fields and use the text box values with the name of $from value and $tovalue
Someone