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
https://forums.phpfreaks.com/topic/104888-solved-form-data-with-double-quotes/
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()

 

 

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.

 

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.