1
  1. I need the post value of 'isp_value'

    while ($result = mysql_fetch_array($isp_tab)) 
     {
        $isp_value = $result[0];
        echo '<input class="tablinks ion-social-rss" type="submit" name="isp_value[]" value="'.$isp_value.'">';
        echo '<input type="hidden" name="isp_hidden_value[]" value="'.$isp_value.'">';
    
     } 
    
  2. Im getting hidden value of isp_hidden_value[] but not the value of isp_value[]

    $data = $_POST['isp_hidden_value'];
        foreach($data as $isp)
        {
            echo "isp_hidden =".$isp; //this echo works and show all the values in a row
        }
    if(isset($_POST['isp_value'])) //if condition fails isp_value is not set(!isset)
        {
                //$isp = $_POST['isp_value'];
                //echo 'isp  = '.$isp;
                print_r($_POST['isp_value']);
    
        }
    
  3. I need the submitted one value from isp_value

  4. By using <?php var_dump($_POST);?> all values in a row from name='hidden_value[]' are shown but not a single submitted value from name='isp_value[]'.

    ["isp_hidden_value"]=> array(9) { ["comcast"]=> string(7) "comcast" ["yahoo"]=> string(5) "yahoo" ["gmail"]=> string(5) "gmail" ["roadrunner"]=> string(10) "roadrunner" ["verizon"]=> string(7) "verizon" ["att"]=> string(3) "att" ["hotmail"]=> string(7) "hotmail" ["aol"]=> string(3) "aol" ["juno"]=> string(4) "juno" } } 
    

Anyone help me solve this problem

Jones Joseph
  • 4,703
  • 3
  • 22
  • 40
Puvi
  • 41
  • 2
  • 12
  • `$isp` is an array, you can't echo it. Also, why you need array for button? simply use `name='isp_value'`. You will press only one button to submit the form – Thamilhan May 24 '17 at 08:57
  • You have to change input type from button to some other type. – Ranjeet Singh May 24 '17 at 08:58
  • either print_r($_POST['isp_value']); also didn't work @Thamilan – Puvi May 24 '17 at 08:59
  • i'm using input type="submit" @RanjeetSingh – Puvi May 24 '17 at 09:02
  • You have already posted similar question. What is your exact need? Is the first comment not enough for you to proceed? https://stackoverflow.com/questions/44149391/how-to-get-the-submit-button-value-which-is-in-while-loop-using-post-method – Thamilhan May 24 '17 at 09:06
  • I have posted the previous question for getting hidden fields and how to get the post values but now my problem is submit button is not set (!isset($_POST['isp_value']) condition is true now i need to solve this @Thamilan – Puvi May 24 '17 at 09:11
  • how to set static value for isp_value inside the loop @Thamilan – Puvi May 24 '17 at 09:14
  • Isn't it fine? `echo '';` – Thamilhan May 24 '17 at 09:18
  • that also not working is it possible to ve 2 submit buttons in a form does that cause any issues? @Thamilan – Puvi May 24 '17 at 09:28
  • 1
    No, you can have – Thamilhan May 24 '17 at 09:29
  • thanks for your replies @Thamilan – Puvi May 24 '17 at 09:48
  • Does that work? – Thamilhan May 24 '17 at 09:48
  • nope :( @Thamilan – Puvi May 24 '17 at 09:52
  • if i use isp_value as select option and submit it using another button it works and shows the result, but if i use 'isp_value' as a tab and submit it 'isp_value' is not set @Thamilan – Puvi May 24 '17 at 10:15
  • $isp_value also will be an array. Even if only one is submitted, you have defined it like isp_value[], so it will be an array. Use it like this - $data = $_POST['isp_hidden']; foreach($data as $isp) { echo "isp =".$isp; } – T.Shah May 24 '17 at 10:47
  • now i need one submitted tab value refer my previous question. @T.Shah – Puvi May 24 '17 at 11:18
  • It will give only one value - the one that is clicked. – T.Shah May 24 '17 at 11:20
  • yeah i tried that one @T.Shah but not working refer this https://stackoverflow.com/questions/44149391/how-to-get-the-submit-button-value-which-is-in-while-loop-using-post-method for full code – Puvi May 24 '17 at 11:22

0 Answers0