close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problem with "

Thread began 5/31/2012 11:44 am by J7HNW | Last modified 6/01/2012 12:47 pm by Jason Byrnes | 1102 views | 15 replies |

J7HNW

Problem with "

We have universal e mail 4 collecting data from a MySQL database ( in hiddeen fields ) and mailing an HTML e mail to our customer

However if anybody happens to type in " as in 12" x 9" x 3" - it stops the mail from coming through properly

Please see attached. As soon as I take out the " it works fine

How do I work around this please

John

Attached Files
Dear Mr Parvez.zip
Sign in to reply to this post

Jason ByrnesWebAssist

try adding the following code at line 1 of your page;

php:
<?php
@session_start();
if(
$_SERVER["REQUEST_METHOD"] == "POST")     {
    foreach(
$_POST as $k => $v) {
        
$_POST[$k] = htmlspecialchars($vENT_QUOTES);
    }
}
?>




this will convert the quotes to HTML entities.

Sign in to reply to this post

J7HNW

Thanks - but didnt work ?

Hi

I added your code to line one of the Page carrying the UEM4 behaviour and also to the universal_e_mail Quote form in the e mail folder - but no change

Please see attached for my filles ?

Thanks for your help Jason

Attached Files
Desktop.zip
Sign in to reply to this post

Jason ByrnesWebAssist

change:

php:
//$_POST[$k] = htmlspecialchars($v, ENT_QUOTES);




to:

php:
$_POST[$k] = htmlspecialchars($v, ENT_QUOTES);




right after i posted, i realized that line was commented and edited my original post, you must have been quick on ready my reply and got the code before i edited it.

Sign in to reply to this post

J7HNW

Still not working

Hi Jason

Still not working

I now have

<?php
@session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
foreach($_POST as $k => $v) {
$_POST[$k] = htmlspecialchars($v, ENT_QUOTES);
}
}
?>

This is on the first line of the 2 pages I attached in the previous post

Regards

John

Sign in to reply to this post

Jason ByrnesWebAssist

perhaps try using this code then:

php:
<?php

@session_start();
if(
$_SERVER["REQUEST_METHOD"] == "POST")     {
    foreach(
$_POST as $k => $v) {
        
$_POST[$k] = str_replace("\"""&quote;",$v);
    }
}
?>
Sign in to reply to this post

J7HNW

Still no ...

Hi Jason

Tried

<?php
@session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
foreach($_POST as $k => $v) {
$_POST[$k] = str_replace("\"", "&quote;",$v);
}
}
?>


Still no good. Any more ideas ? Thank you for your swift assistance as always

John

Sign in to reply to this post

Jason ByrnesWebAssist

try using the str_replace function in the value of the form elements so that it is already converted before posting. For example:

change:

php:
<input name="quoteref" type="hidden" id="quoteref" value="<?php echo $row_WADAcustomer_quotes['Quote_Ref']; ?>" />




to:

php:
<input name="quoteref" type="hidden" id="quoteref" value="<?php echo str_replace('"''&quot;',$row_WADAcustomer_quotes['Quote_Ref']); ?>" />
Sign in to reply to this post

J7HNW

Almost there...

Hi Jason

It now reads

12\" x 12\" x 12\"

Almost there - any idea how to remove the \

Rgds

John

Sign in to reply to this post

Jason ByrnesWebAssist

use another str_replace function:

php:
<input name="quoteref" type="hidden" id="quoteref" value="<?php echo str_replace('"''&quot;'str_replace('\\''' $row_WADAcustomer_quotes['Quote_Ref'])); ?>" />
Sign in to reply to this post
loading

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...