Jump to content

[SOLVED] Form data with double quotes


thomashw

Recommended Posts

I have a form that submits double quotes, and I'd like PHP to just display the double quotes (not what it's doing right now.)

 

Here's my code:

 

$optionstring = explode('|', $_POST['option' . $i] );
$option = $optionstring[0];

 

I'm not sure how to do it, so if anyone can help that'd be great. :)

Link to comment
Share on other sites

Perhaps it's just me, but i dont understand the question.

 

I have a form that submits double quotes, and I'd like PHP to just display the double quotes (not what it's doing right now.)

 

What do you mean by that? You have a field in your form which sometimes contains double quotes? What do you mean you just like PHP to display the double quotes?

 

My only guess is you wanted to get rid of the forward slash added by magic_quotes? If so, see stripslashes()

 

 

Link to comment
Share on other sites

Yes, I have a form field which can contain double quotes. Currently, the submitted data is displayed up until the double quote and isn't displayed after that. How can I make the double quotes be displayed as well as anything after them?

Link to comment
Share on other sites

The value of a field is being submitted like this:

 

<option value="thisisanoption|option">Option</option>

 

The explode just gets the first half.

 

Now if there was a quote in there, like this:

 

<option value="this isan"option|option">Option</option>

 

Only "this isan" is displayed.

 

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.