close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Magic quote turned off but double quotes still escaped

Thread began 4/05/2013 9:17 am by rikaG_510 | Last modified 1/20/2014 3:38 pm by Jason Byrnes | 654 views | 7 replies |

rikaG_510

Magic quote turned off but double quotes still escaped

Hi Jason,

I just realized that my checkout form (of my shopping site) cannot send double quotes and it seems everything but the first back slash is truncated.

e.g) I type in;

"this is a test"

in a text field in checkout form, then in confirm page it shows as;

\"this is a test \" .

In the database, the value is sent as just

\ .


I checked my server and magic quote is turned off in php.ini.

What could be a possibility for this?
I googled solutions, most of them were about magic quote.
I did see people saying you can use "stripslashes", but not sure if it's useful, or usable in my case. (If it's useful, could you show me how?)

Thank you,
Rika

Sign in to reply to this post

Jason ByrnesWebAssist

there are a couple different magic quotes settings, magic quotes runtime an GPC Magic quotes, one of those is probably enabled.



to use stripslashes, add the following code at line 1 of the confirm page:


php:
<?php

if($_SERVER["REQUEST_METHOD"] == "POST")     {
    foreach(
$_POST as $key => $val) {
        if(
is_array($_POST[$key])) $_POST[$key] = stripslashes($_POST[$key]);
    }
}
?>
Sign in to reply to this post

rikaG_510

Thank you Jason,

I tried stripslashes code you showed me, but still no change.
Then I went back to my server and checked php.ini setting again,
these ones were all off.

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

Is this why the stripslashes isn't working?
If so what could be cause of this problem and any other solution?

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to see the problem in order to troubleshoot the cause.

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

rikaG_510

Hi Jason, I totally forgot about this issue, now I'd like to solve it properly.
I looked into the situation again, then I noticed magic_quotes_gpc was not turned on all this time.

So I turned it off from .htaccess and it seems it's working this time finally, as now the texts entered on contact form with double quotes marks are passed perfectly to confirm page (without back slash, with double quotes marks.)
After this is the problem though. The email sent is missing texts after the first double quotation.

What could you suggest to solve this?

I attached confirm page php file just in case.

Thank you for your help.
Rika

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

rikaG_510

Hi Jason, here is the info for your testing.

Thank you for your help.

Sign in to reply to this post

Jason ByrnesWebAssist

on the us_19_contact_confirm.php page, try adding this code to convert quotes to hTML entities:



<?php
if($_SERVER["REQUEST_METHOD"] == "POST") {
foreach($_POST as $key => $val) {
$_POST[$key] = str_replace("\"","&quot;",$_POST[$key]);
}
}
?>
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...