Jump to content

[SOLVED] post data incomplete


roonnyy

Recommended Posts

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

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.