Jump to content

[SOLVED] double quotes ...


Avihai

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

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.