Extracting Post Variables
Posted: Tue Dec 19, 2006 11:27 am
I am working on a page that writes to a CSV and the form that it is getting the information from has about 25 fields and they are all necessary fields. So instead of doing individual variable assignments i just put them through a for loop like this...
The replace portion in there is just for the csv don't worry about that. My problem is when it goes through all of the variables it extracts a variable called 'x' and one called 'y'. They come with random values too x is usually between like 80-100 and y is usually between 5-30 in value. It works if i just put these as a hidden field in firefox and set their value to nothing but in IE it still writes the values in. I know it is making these variables because i printed them all out and they print out all the way at the end but these are nowhere to be found in my form. Is this a server configuration issue? It didn't do this on the development server i was using but the server it is on now puts these in. Help would be greatly appreciated! Thank you!
Code: Select all
foreach($_POST as $name => $value)
{
$replace = str_replace(",","",$value);
$data .= '"' . trim($replace) . '"' . ",";
}