473,387 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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
Jan 12 '08 #1
11 3413
MarkoKlacar
296 Expert 100+
Hi,

could you please post some code that produces the output?

Cheers

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
Jan 14 '08 #2
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
Feb 22 '08 #3
Hi,

could you please post some code that produces the output?

Cheers
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. if ($_POST['methodUI'] == "1") {
  4. $link = mysql_connect('DB details);
  5. if (!$link) {
  6.     die('Could not connect: ' . mysql_error());
  7. }
  8. mysql_select_db('app_pw_container');
  9. $query="SELECT pkey_app_name FROM main_up";
  10. $result=mysql_query($query);
  11.  
  12. echo '<form method="post" action="update.php" name="form2">';
  13. echo "<table>";
  14. echo '<tr><td>App Name:';
  15. echo '<select name="appName"><option>Select Application Name</option>';
  16.  
  17. while($row=mysql_fetch_array($result)) {
  18. echo '<option value>';
  19. echo $row["pkey_app_name"];
  20. echo "</option>";
  21. }
  22. echo '</select></td></tr>';
  23. echo '<tr><td><label>Username: <input type="text" name="username" maxlength="40"></label></td></tr>';
  24. echo '<tr><td><label>Password: <input type="password" name="pass" maxlength="40"></label></td></tr>';
  25. echo '<tr><td><input type="submit" name="update" value="Submit"></td></tr>';
  26. echo "</table>";
  27. echo "</form>";
  28.  
  29. }
  30.  
  31.  
  32. elseif ($_POST['methodUI'] == "2") {
  33. echo '<form method="post" action="update.php" name="form2">';
  34. echo "<table>";
  35. echo '<tr><td><label>App Name: <input type="text" name="appName" maxlength="40"></label></td></tr>';
  36. echo '<tr><td><label>Username: <input type="text" name="username" maxlength="40"></label></td></tr>';
  37. echo '<tr><td><label>Password: <input type="password" name="pass" maxlength="40"></label></td></tr>';
  38. echo '<tr><td><input type="submit" name="submit" value="Submit"></td></tr>';
  39. echo "</table>";
  40. echo "<br>";
  41. echo "</form>";
  42.  
  43. }
  44.  
  45. ?>
  46.  
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
Feb 22 '08 #4
ronverdonk
4,258 Expert 4TB
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
Expand|Select|Wrap|Line Numbers
  1. $link = mysql_connect('DB details);
needas a closing single quote in the connect.

Ronald
Feb 22 '08 #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
Expand|Select|Wrap|Line Numbers
  1. $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.

Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="inputform.php" name="forminput">
  2. <table>
  3. <tr>
  4. <td>Select Method: </td>
  5.  
  6. <td>
  7. <select name="methodUI">
  8.     <option value="1">Update Current Application Details</option>
  9.     <option value="2">Insert New Application Details</option>
  10. </select>
  11. </td>
  12. </tr>
  13.  
  14. <tr>
  15. <td>
  16. <input type="submit" name"submitip" value="Submit">
  17. </td>
  18. </tr>
  19. </table>
  20. </form>
  21.  

Much appreciate your help.

Best,
AJ
Feb 22 '08 #6
ronverdonk
4,258 Expert 4TB
Thius application runs fine in both IE and FF, except for a minor error in statement
Expand|Select|Wrap|Line Numbers
  1. <input type="submit" name"submitip" value="Submit">
  2.  
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">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>[/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:
Expand|Select|Wrap|Line Numbers
  1. Array
  2. (
  3.     [methodUI] => 2
  4.     [submitip] => Submit
Ronald
Feb 22 '08 #7
Thius application runs fine in both IE and FF, except for a minor error in statement
Expand|Select|Wrap|Line Numbers
  1. <input type="submit" name"submitip" value="Submit">
  2.  
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">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>[/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:
Expand|Select|Wrap|Line Numbers
  1. Array
  2. (
  3.     [methodUI] => 2
  4.     [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

Expand|Select|Wrap|Line Numbers
  1. 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.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. if ($_POST['methodUI'] == "1") {
  4. echo '<form method="post" action="update.php" name="form2">';
  5.  
  6. $link = mysql_connect('DB Details');
  7. if (!$link) {
  8.     die('Could not connect: ' . mysql_error());
  9. }
  10. mysql_select_db('app_pw_container');
  11. $query="SELECT pkey_app_name FROM main_up";
  12. $result=mysql_query($query);
  13.  
  14. echo "<table>";
  15. echo '<tr><td>App Name:';
  16. echo '<select name="appName" id="appNameID"><option>Select Application Name</option>';
  17.  
  18. while($row=mysql_fetch_array($result)) {
  19. echo '<option value>';
  20. echo $row["pkey_app_name"];
  21. echo "</option>";
  22. }
  23. echo '</select></td></tr>';
  24. echo '<tr><td><label>Username: <input type="text" name="username" maxlength="40"></label></td></tr>';
  25. echo '<tr><td><label>Password: <input type="password" name="pass" maxlength="40"></label></td></tr>';
  26. echo '<tr><td><input type="submit" name="update" value="Submit"></td></tr>';
  27. echo "</table>";
  28. echo "</form>";
  29.  
  30. }
  31.  
  32.  
  33. elseif ($_POST['methodUI'] == "2") {
  34. echo '<form method="post" action="update.php" name="form2">';
  35. echo "<table>";
  36. echo '<tr><td><label>App Name: <input type="text" name="appName" maxlength="40"></label></td></tr>';
  37. echo '<tr><td><label>Username: <input type="text" name="username" maxlength="40"></label></td></tr>';
  38. echo '<tr><td><label>Password: <input type="password" name="pass" maxlength="40"></label></td></tr>';
  39. echo '<tr><td><input type="submit" name="submit" value="Submit"></td></tr>';
  40. echo "</table>";
  41. echo "<br>";
  42. echo "</form>";
  43.  
  44. }
  45.  
  46. ?>
Also pasting the last update.php
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $appname = $_POST['appName'];
  4. $uname = $_POST['username'];
  5. $passw = $_POST['pass'];
  6.  
  7. echo var_dump($appname);
  8. echo var_dump($uname);
  9. echo var_dump($passw);
  10.  ?>
  11.  
I don't know if I am clear yet or not. Feel free to curse or shout if I am not. :)

Best,
AJ
Feb 22 '08 #8
Thius application runs fine in both IE and FF, except for a minor error in statement
Expand|Select|Wrap|Line Numbers
  1. <input type="submit" name"submitip" value="Submit">
  2.  
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">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>[/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:
Expand|Select|Wrap|Line Numbers
  1. Array
  2. (
  3.     [methodUI] => 2
  4.     [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.

Expand|Select|Wrap|Line Numbers
  1. Array
  2. (
  3.     [appName] => 
  4.     [username] => fdghdhd
  5.     [pass] => dgdgh
  6.     [update] => Submit
  7. )


Whereas in IE, the output was -
Expand|Select|Wrap|Line Numbers
  1. Array
  2. (
  3.     [appName] => testing_gendb
  4.     [username] => fgfdgf
  5.     [pass] => cvcv
  6.     [update] => Submit
  7. )
Feb 22 '08 #9
ronverdonk
4,258 Expert 4TB
Try this one for row 19:
[php]
echo '<option value="'.$row['pkey_app_name'].'">'.$row["pkey_app_name"].'</option>';[/php]
Ronald
Feb 22 '08 #10
Try this one for row 19:
[php]
echo '<option value="'.$row['pkey_app_name'].'">'.$row["pkey_app_name"].'</option>';[/php]
Ronald
Works like a charm. :)

Why was I missing this?

Thanks a lot Ronald.

Best,
AJ
Feb 22 '08 #11
ronverdonk
4,258 Expert 4TB
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
Feb 22 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
3
by: tornado | last post by:
Hi all, I am pretty new to PHP. I was reading PHP manual and trying out the example from 2nd chapter (A simple Tutorial). When i try to print the variable as given in the example it returns...
13
by: Rudolf Horbas | last post by:
G'day, has any of You ever experienced the problem that posted forms deliver an empty $_POST-array? I have a form like: <form method="POST" action="https://.../result.html?qid=70"> <input...
6
by: lawrence | last post by:
I've the form you see below, which is supposed to upload an image. I expect the image name as a var to be $uploadedFile. In the receiving function, I've this code: global $uploadedFile,...
1
by: a c s | last post by:
Hi there, my problem is as follows: When emailing a file using PHP 4.0.6, the attachment received is an empty "attachment.txt" file instead of the actual file I attached. Any suggestions why...
7
by: Dan | last post by:
I was trying to troubleshoot a login page that doesn't work - it keeps saying the login/password is missing - when my tracing discovered this peculiar behavior. register_globals is off, so at...
5
by: Thejo | last post by:
Hi all, I started programming in PHP recently and have a query about empty $_POST arrays. I can see two scenarios when this could happen. 1. When some tries to directly load the page to which...
5
by: lorenzdominic_ | last post by:
Hi Recently I have been developing a form that uses the _POST variable. Today the _POST variable was empty everytime I submitted my form however I changed the post method to be GET and the...
1
by: fishctr | last post by:
Hi There, I am building a form that allows a business to enter at most 2 mailing addresses. i have the form set up so both inputs are there, storing as a post array. the problem is, when i try to...
9
by: Dhiru1009 | last post by:
Hi guys, I am trying to build a user registration form using PHP and MYSQL but encountring a problem. When I click on submit with empty fields it adds records to database also it doesn't matter...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.