Jump to content

Recommended Posts

Hi all,

 

I have a string that is being pulled from the db (example: Q"A) and as I echo it it works fine.

The problem is when I send this string as a var to my email, I get only the Q because of the quote sign.

 

Is there ANY way to take the var as is (Q"A) by disregarding the quotes in the string???

 

Thanks,

A.O

Link to comment
https://forums.phpfreaks.com/topic/106521-solved-double-quotes/
Share on other sites

ah...the problem is in your hidden field, make sure you escape it there:

<input type="hidden" value="Q"A" />

if it's a php variable echoing into the value, use:

<?php
  $var = 'Q"A';
  echo '<input type="hidden" value="'.htmlspecialchars($var).'" />';
?>

Link to comment
https://forums.phpfreaks.com/topic/106521-solved-double-quotes/#findComment-546047
Share on other sites

if slashes are added to your POST vars and you want to remove them, use stripslashes():

 

$some_val = stripslashes($_POST['some_val']);

 

stripslashes should work, but the better option (if you can do it) is to turn off magic_quotes: http://us3.php.net/manual/en/security.magicquotes.disabling.php

Link to comment
https://forums.phpfreaks.com/topic/106521-solved-double-quotes/#findComment-546128
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.