Jump to content

doublequotes in array values?


nezbie

Recommended Posts

Let's say i have lots of inputfields that have values where doublequotes are used, like: <input type="text" value="\"myvalue\"" name="mytextfield[0][0]"> ( used addslashes to prevent value=""myvalue""> )

In page, this displays correctly, also in sourcecode

But when posting, $_POST array shows only \\ or " or \ where there should be a "myvalue". I've tried to search the forums and google / manual but no matter what i do the post array returns one of the following useless values described above.. What am I doing wrong with this?

:'(
Link to comment
https://forums.phpfreaks.com/topic/31469-doublequotes-in-array-values/
Share on other sites

I use it for:

structure of textfields = mytextfield[rowNR][colNR] (has a value), like mytextfield[0][5] = value (can also be "value")

all the data are read and written to a [b]textfile[/b]

[b]// save post as CSV
foreach ($_POST['mytextfield'] as $key=>$value) {
 
  $parsedData .= implode(';', $value) . "\r\n";

}
[/b]
so when foreaching an array, or otherwise handling arrays

but I print out $_POST before any action after I have submitted the form, the "errorneus data" is visible there already. So in the foreach loop, the $value could be anything like 1234 or "1234" or Jim or "Jim"

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.