Empty form data with POST

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • iReachable
    New Member
    • Jan 2008
    • 1

    Empty form data with POST

    Hi!

    We are seeeing many users with XP experiencing empty form data issue.

    Browwer = Explorer 7.0, OS = Windows Vista
    Browser = Firefox 2.0.0, OS = Windows XP
    Browser = Explorer 6.0, OS = Windows XP
    Browser = Firefox 1.0.7, OS = Windows XP
    Broswer = Opera 9.25, OS = Windows XP

    The form is submitted using POST. For testing we are using XP/Explorer 6.0 client and we don't see issue at all. It is only some users who are experiencing this issue.

    Any help would be appreciated. URL

    http://www.ireachable. com/vote
  • MarkoKlacar
    Recognized Expert Contributor
    • Aug 2007
    • 296

    #2
    Hi,

    could you please post some code that produces the output?

    Cheers

    Originally posted by iReachable
    Hi!

    We are seeeing many users with XP experiencing empty form data issue.

    Browwer = Explorer 7.0, OS = Windows Vista
    Browser = Firefox 2.0.0, OS = Windows XP
    Browser = Explorer 6.0, OS = Windows XP
    Browser = Firefox 1.0.7, OS = Windows XP
    Broswer = Opera 9.25, OS = Windows XP

    The form is submitted using POST. For testing we are using XP/Explorer 6.0 client and we don't see issue at all. It is only some users who are experiencing this issue.

    Any help would be appreciated. URL

    http://www.ireachable. com/vote

    Comment

    • amanjsingh
      New Member
      • Mar 2007
      • 48

      #3
      Originally posted by iReachable
      Hi!

      We are seeeing many users with XP experiencing empty form data issue.

      Browwer = Explorer 7.0, OS = Windows Vista
      Browser = Firefox 2.0.0, OS = Windows XP
      Browser = Explorer 6.0, OS = Windows XP
      Browser = Firefox 1.0.7, OS = Windows XP
      Broswer = Opera 9.25, OS = Windows XP

      The form is submitted using POST. For testing we are using XP/Explorer 6.0 client and we don't see issue at all. It is only some users who are experiencing this issue.

      Any help would be appreciated. URL

      http://www.ireachable.com/vote
      I have a similar issue...when using IE 6 variable is displayed but it sends a "" when using Firefox. Both under Windows 2000/XP

      Any solutions to this problem would be highly appreciated.

      Thanks
      AJ

      Comment

      • amanjsingh
        New Member
        • Mar 2007
        • 48

        #4
        Originally posted by MarkoKlacar
        Hi,

        could you please post some code that produces the output?

        Cheers
        Code:
        <?php
        
        if ($_POST['methodUI'] == "1") {
        $link = mysql_connect('DB details);
        if (!$link) {
            die('Could not connect: ' . mysql_error());
        }
        mysql_select_db('app_pw_container');
        $query="SELECT pkey_app_name FROM main_up";
        $result=mysql_query($query);
        
        echo '<form method="post" action="update.php" name="form2">';
        echo "<table>";
        echo '<tr><td>App Name:';
        echo '<select name="appName"><option>Select Application Name</option>';
        
        while($row=mysql_fetch_array($result)) {
        echo '<option value>';
        echo $row["pkey_app_name"];
        echo "</option>";
        }
        echo '</select></td></tr>';
        echo '<tr><td><label>Username: <input type="text" name="username" maxlength="40"></label></td></tr>';
        echo '<tr><td><label>Password: <input type="password" name="pass" maxlength="40"></label></td></tr>';
        echo '<tr><td><input type="submit" name="update" value="Submit"></td></tr>';
        echo "</table>";
        echo "</form>";
        
        }
        
        
        elseif ($_POST['methodUI'] == "2") {
        echo '<form method="post" action="update.php" name="form2">';
        echo "<table>";
        echo '<tr><td><label>App Name: <input type="text" name="appName" maxlength="40"></label></td></tr>';
        echo '<tr><td><label>Username: <input type="text" name="username" maxlength="40"></label></td></tr>';
        echo '<tr><td><label>Password: <input type="password" name="pass" maxlength="40"></label></td></tr>';
        echo '<tr><td><input type="submit" name="submit" value="Submit"></td></tr>';
        echo "</table>";
        echo "<br>";
        echo "</form>";
        
        }
        
        ?>
        I have put in the text. Basically, I am trying to populate the combobox with values from database. The other two normal text fields pass the variable value to the next page but only the combobox value isn't passed and this happens only in Firefox.

        Thanks
        AJ

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          There is no field with the name 'methodUI' in your form. So what is it you are testing in the $_POST array? If the code shown is not all of it, show it.

          Btw: statement
          Code:
          $link = mysql_connect('DB details);
          needas a closing single quote in the connect.

          Ronald

          Comment

          • amanjsingh
            New Member
            • Mar 2007
            • 48

            #6
            Originally posted by ronverdonk
            There is no field with the name 'methodUI' in your form. So what is it you are testing in the $_POST array? If the code shown is not all of it, show it.

            Btw: statement
            Code:
            $link = mysql_connect('DB details);
            needas a closing single quote in the connect.

            Ronald
            Thanks for the response ronverdonk

            DB details are correct.

            This form is displayed on the basis of a value (methodUI) from a previous form which either sends a "1" or a "2". It is basically a dropdown list where user selects on of the two choices. Based on that, on the next page, respective form is showed.

            This is working fine in IE but not in FF.

            Code:
            <form method="post" action="inputform.php" name="forminput">
            <table>
            <tr>
            <td>Select Method: </td>
            
            <td>
            <select name="methodUI">
            	<option value="1">Update Current Application Details</option>
            	<option value="2">Insert New Application Details</option>
            </select>
            </td>
            </tr>
            
            <tr>
            <td>
            <input type="submit" name"submitip" value="Submit">
            </td>
            </tr>
            </table>
            </form>

            Much appreciate your help.

            Best,
            AJ

            Comment

            • ronverdonk
              Recognized Expert Specialist
              • Jul 2006
              • 4259

              #7
              Thius application runs fine in both IE and FF, except for a minor error in statement
              Code:
              <input type="submit" name"submitip" value="Submit">
              where you forgot the '=' .
              I'll show you what I did: took your code and changed the action to b.php.
              So here is your code[php]<form method="post" action="b.php" name="forminput ">
              <table>
              <tr>
              <td>Select Method: </td>

              <td>
              <select name="methodUI" >
              <option value="1">Updat e Current Application Details</option>
              <option value="2">Inser t New Application Details</option>
              </select>
              </td>
              </tr>

              <tr>
              <td>
              <input type="submit" name="submitip" value="Submit">
              </td>
              </tr>
              </table>
              </form>[/php]
              and here is the code for b.php:[php]<?php
              echo '<pre>'; print_r($_POST) ;
              ?>[/php]
              Running the program in IE and FF, selection the 2nd option and submitting results in b.php being executed and the results are:
              Code:
              Array
              (
                  [methodUI] => 2
                  [submitip] => Submit
              )
              Ronald

              Comment

              • amanjsingh
                New Member
                • Mar 2007
                • 48

                #8
                Originally posted by ronverdonk
                Thius application runs fine in both IE and FF, except for a minor error in statement
                Code:
                <input type="submit" name"submitip" value="Submit">
                where you forgot the '=' .
                I'll show you what I did: took your code and changed the action to b.php.
                So here is your code[php]<form method="post" action="b.php" name="forminput ">
                <table>
                <tr>
                <td>Select Method: </td>

                <td>
                <select name="methodUI" >
                <option value="1">Updat e Current Application Details</option>
                <option value="2">Inser t New Application Details</option>
                </select>
                </td>
                </tr>

                <tr>
                <td>
                <input type="submit" name="submitip" value="Submit">
                </td>
                </tr>
                </table>
                </form>[/php]
                and here is the code for b.php:[php]<?php
                echo '<pre>'; print_r($_POST) ;
                ?>[/php]
                Running the program in IE and FF, selection the 2nd option and submitting results in b.php being executed and the results are:
                Code:
                Array
                (
                    [methodUI] => 2
                    [submitip] => Submit
                )
                Ronald
                Ronald, wow. you take a lot of effort. I am really amazed. :)

                I can very well get the output of methodUI to the next page where using methodUI value I will create a form depending on the value of methodUI. I can very well get to the part where methodUI is being passed successfully and the appropriate form is being generated on the next level. But for

                Code:
                methodUI=="1"
                I have a dropdown list from database. If you see the code below, there is a dropdown list in the if section where methodUI=="1". the second section works fine but in the first section when i select the dropdown value and hit Submit, it does not output the value from the dropdown list. So, this is not about methodUI 's value being passed or not, it is being passed. Problem is with the <select> I think.

                Code:
                <?php
                
                if ($_POST['methodUI'] == "1") {
                echo '<form method="post" action="update.php" name="form2">';
                
                $link = mysql_connect('DB Details');
                if (!$link) {
                    die('Could not connect: ' . mysql_error());
                }
                mysql_select_db('app_pw_container');
                $query="SELECT pkey_app_name FROM main_up";
                $result=mysql_query($query);
                
                echo "<table>";
                echo '<tr><td>App Name:';
                echo '<select name="appName" id="appNameID"><option>Select Application Name</option>';
                
                while($row=mysql_fetch_array($result)) {
                echo '<option value>';
                echo $row["pkey_app_name"];
                echo "</option>";
                }
                echo '</select></td></tr>';
                echo '<tr><td><label>Username: <input type="text" name="username" maxlength="40"></label></td></tr>';
                echo '<tr><td><label>Password: <input type="password" name="pass" maxlength="40"></label></td></tr>';
                echo '<tr><td><input type="submit" name="update" value="Submit"></td></tr>';
                echo "</table>";
                echo "</form>";
                
                }
                
                
                elseif ($_POST['methodUI'] == "2") {
                echo '<form method="post" action="update.php" name="form2">';
                echo "<table>";
                echo '<tr><td><label>App Name: <input type="text" name="appName" maxlength="40"></label></td></tr>';
                echo '<tr><td><label>Username: <input type="text" name="username" maxlength="40"></label></td></tr>';
                echo '<tr><td><label>Password: <input type="password" name="pass" maxlength="40"></label></td></tr>';
                echo '<tr><td><input type="submit" name="submit" value="Submit"></td></tr>';
                echo "</table>";
                echo "<br>";
                echo "</form>";
                
                }
                
                ?>
                Also pasting the last update.php
                Code:
                <?php
                
                $appname = $_POST['appName'];
                $uname = $_POST['username'];
                $passw = $_POST['pass'];
                
                echo var_dump($appname);
                echo var_dump($uname);
                echo var_dump($passw);
                 ?>
                I don't know if I am clear yet or not. Feel free to curse or shout if I am not. :)

                Best,
                AJ

                Comment

                • amanjsingh
                  New Member
                  • Mar 2007
                  • 48

                  #9
                  Originally posted by ronverdonk
                  Thius application runs fine in both IE and FF, except for a minor error in statement
                  Code:
                  <input type="submit" name"submitip" value="Submit">
                  where you forgot the '=' .
                  I'll show you what I did: took your code and changed the action to b.php.
                  So here is your code[php]<form method="post" action="b.php" name="forminput ">
                  <table>
                  <tr>
                  <td>Select Method: </td>

                  <td>
                  <select name="methodUI" >
                  <option value="1">Updat e Current Application Details</option>
                  <option value="2">Inser t New Application Details</option>
                  </select>
                  </td>
                  </tr>

                  <tr>
                  <td>
                  <input type="submit" name="submitip" value="Submit">
                  </td>
                  </tr>
                  </table>
                  </form>[/php]
                  and here is the code for b.php:[php]<?php
                  echo '<pre>'; print_r($_POST) ;
                  ?>[/php]
                  Running the program in IE and FF, selection the 2nd option and submitting results in b.php being executed and the results are:
                  Code:
                  Array
                  (
                      [methodUI] => 2
                      [submitip] => Submit
                  )
                  Ronald
                  I just tried your way on the second form which has appName...
                  Please note that the appName is not being passed at all in FF.

                  Code:
                  Array
                  (
                      [appName] => 
                      [username] => fdghdhd
                      [pass] => dgdgh
                      [update] => Submit
                  )


                  Whereas in IE, the output was -
                  Code:
                  Array
                  (
                      [appName] => testing_gendb
                      [username] => fgfdgf
                      [pass] => cvcv
                      [update] => Submit
                  )

                  Comment

                  • ronverdonk
                    Recognized Expert Specialist
                    • Jul 2006
                    • 4259

                    #10
                    Try this one for row 19:
                    [php]
                    echo '<option value="'.$row['pkey_app_name'].'">'.$row["pkey_app_n ame"].'</option>';[/php]
                    Ronald

                    Comment

                    • amanjsingh
                      New Member
                      • Mar 2007
                      • 48

                      #11
                      Originally posted by ronverdonk
                      Try this one for row 19:
                      [php]
                      echo '<option value="'.$row['pkey_app_name'].'">'.$row["pkey_app_n ame"].'</option>';[/php]
                      Ronald
                      Works like a charm. :)

                      Why was I missing this?

                      Thanks a lot Ronald.

                      Best,
                      AJ

                      Comment

                      • ronverdonk
                        Recognized Expert Specialist
                        • Jul 2006
                        • 4259

                        #12
                        Originally posted by amanjsingh
                        Works like a charm. :)

                        Why was I missing this?

                        Thanks a lot Ronald.

                        Best,
                        AJ
                        Being awake (possibly)?
                        Anyway, great it works. See you again.

                        Ronald

                        Comment

                        Working...