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
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"
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.