|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Can't email anything in double quotes
Hi,
This is really annoying cos it seems so easy. I've created two php files: One with a form, and the second with a preview page that displays the submitted data from that form. The second file also contains a mail function which is called when the user clicks send if they're happy with the preview. Then the submitted data gets sent to my email address. Pretty straight forward, right? My problem happens if the user has written something that contains double quotes when they filled out the form. Anything between double quotes AND after will not display when the data is emailed to me. WHY? Single quotes work fine. It's just the double quotes. EXAMPLE If the user writes: Hello there "how are you" ? All I get sent is: Hello there This is the contents of the mail function that sends the email: PHP Code:
To display the preview page I send all of the submitted data from page one through a validation function in page two. The data comes out of the validation as a variable and that variable is displayed in the preview message. So is the above code the right way to send that data to my email address?? Surely it's not that complicated to solve, Thanks for any help. |
|
#2
|
|||
|
|||
|
Sometime double quotes within double quotes does not work. I am not sure if it will work, but try this.
if ($success) { header ("location:<a href='http://www.somewhere.com/thanks.html' target='_blank'>http://www.somewhere.com/thanks.html</a>"); } else header ("location:<a href='http://www.somewhere.com/error.html' target='_blank'>http://www.somewhere.com/error.html</a>"); } |
|
#3
|
|||
|
|||
|
Thanks, but that wasn't what my problem is. That part of my script actually works.
My problem is to do with what the user actually types in to my form. If they type: hello "there" my preview page displays it as: hello "there" BUT when this is emailed to me from the form, I only get : hello |
|
#4
|
|||
|
|||
|
This might work... try converting your quotes into coded characters.
PHP Code:
|
|
#5
|
|||
|
|||
|
Quote:
AH HA! Problem solved. Oyejorge, out of about 15-20 people from different forums that have tried to help me, you're the only one who hit the nail on the head. Thanks soooooo much. ![]() |
|
#6
|
|||
|
|||
|
Thank you Slash, glad I could help.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Can't email anything in double quotes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|