i have problem with slashes and quotes!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mekha
Forum Contributor
Posts: 112
Joined: Sat Mar 31, 2012 6:50 am

i have problem with slashes and quotes!

Post by mekha »

i have problem with slashes and quotes!...

hi,i get the word like this:
if the word is: art"ssef
i get it like this:
art"/ssef
---
sometimes get it like that too:
art
and the "ssef is removed!....can some ne help me please ?
User avatar
mixa2000
Forum Newbie
Posts: 18
Joined: Fri Jun 22, 2012 4:50 pm

Re: i have problem with slashes and quotes!

Post by mixa2000 »

Try this, this should totally work, please reply if it does. :)

Code: Select all

<?php
echo ('art"seff');
?>
mekha
Forum Contributor
Posts: 112
Joined: Sat Mar 31, 2012 6:50 am

Re: i have problem with slashes and quotes!

Post by mekha »

no no man, i know thats work....but i mean php & mysql ... sorry i forgot to say thant :crazy:
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: i have problem with slashes and quotes!

Post by social_experiment »

When you display data from a database you can use stripslashes() to remove any slashes used to escape certain characters (like " or ') and then you should use htmlentities() to convert the characters (" and ' among others) to html-safe characters.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
mixa2000
Forum Newbie
Posts: 18
Joined: Fri Jun 22, 2012 4:50 pm

Re: i have problem with slashes and quotes!

Post by mixa2000 »

Well yes you didn't mention about "php & mysql" that's why I answered it that way.
Post Reply