roonnyy Posted April 4, 2009 Share Posted April 4, 2009 Hi guys, I have got problem with POST data. here is my code (everything works fine until that POST value is incomplete). When I post data from one page to another it is lost part of original value. <form action="do.php" method="post"> <? $meat = array( 1=> "without food", 2=> "Chicken Masala (xyzxyz)", 3=> "Chicken Curry (xyzxyz)", 4=> "Chicken Korma (xyzxyz)", 5=> "Chicken Palak (xyzxyz)", 6=> "Butter Chicken (xyzxyz)", 7=> "Chicken Kadai (xyzxyz)", 8=> "Chicken Mushroom (xyzxyz)", 9=> "Chicken Aloo (xyzxyz)", 10=> "Chicken Dal (xyzxyz)", ); //DROP DOWN MENU WITH ARRAY VALUE echo '<strong>MONDAY</strong><br/><br/>'; $category = str_replace(" ", " ", $meat); echo '<strong>1. </strong><SELECT name=monday1>'; foreach ($meat as $key => $value) { echo '<OPTION value='.$value.'> '.$value.''; } echo '</select>'; After this value is send into do.php it retrieves for example only WITHOUT (above WITHOUT FOOD-this is first value in array) or CHICKEN (above Chicken Masala (xyzxyz)-second value in array ) I will appreciate any help.... Link to comment https://forums.phpfreaks.com/topic/152604-solved-post-data-incomplete/ Share on other sites More sharing options...
jackpf Posted April 4, 2009 Share Posted April 4, 2009 Option tags generally need to be closed... Link to comment https://forums.phpfreaks.com/topic/152604-solved-post-data-incomplete/#findComment-801451 Share on other sites More sharing options...
PFMaBiSmAd Posted April 5, 2009 Share Posted April 5, 2009 The value="..." parameter needs to be enclosed in quotes to make valid HTML and it would not hurt to use htmlentities() with the ENT_QUOTES 2nd parameter on all content you output so that any HTML entities that you might choose to put in the output does not break the HTML code on your page. Link to comment https://forums.phpfreaks.com/topic/152604-solved-post-data-incomplete/#findComment-801455 Share on other sites More sharing options...
roonnyy Posted April 5, 2009 Author Share Posted April 5, 2009 thanks for your reply! I'm sorry but could you give me some example what you exactly mean? Link to comment https://forums.phpfreaks.com/topic/152604-solved-post-data-incomplete/#findComment-801456 Share on other sites More sharing options...
PFMaBiSmAd Posted April 5, 2009 Share Posted April 5, 2009 http://w3schools.com/tags/att_option_value.asp Link to comment https://forums.phpfreaks.com/topic/152604-solved-post-data-incomplete/#findComment-801467 Share on other sites More sharing options...
roonnyy Posted April 5, 2009 Author Share Posted April 5, 2009 I changed it to this: echo '<OPTION value="'.$value.'"> '.$value.''; but still same result... :-\ Link to comment https://forums.phpfreaks.com/topic/152604-solved-post-data-incomplete/#findComment-801473 Share on other sites More sharing options...
PFMaBiSmAd Posted April 5, 2009 Share Posted April 5, 2009 Well, I tried your code with the change you said you made and it works, so either you did not actually run the changed code, you are using a browser that is having a problem with the missing closing </option> tag like jackpf posted, or your code that is receiving the form data and displaying it contains the same problem of no quotes around value="..." parameters. Link to comment https://forums.phpfreaks.com/topic/152604-solved-post-data-incomplete/#findComment-801675 Share on other sites More sharing options...
roonnyy Posted April 5, 2009 Author Share Posted April 5, 2009 thank you very much for support. If is my code working for you must work for me to . I'll find out where is the problem! Link to comment https://forums.phpfreaks.com/topic/152604-solved-post-data-incomplete/#findComment-801750 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.