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

i have problem with slashes and quotes!

Postby mekha » Wed Aug 01, 2012 3:05 am

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 ?
mekha
Forum Contributor
 
Posts: 112
Joined: Sat Mar 31, 2012 6:50 am

Re: i have problem with slashes and quotes!

Postby mixa2000 » Wed Aug 01, 2012 3:18 am

Try this, this should totally work, please reply if it does. :)
Syntax: [ Download ] [ Hide ]
<?php
echo ('art"seff');
?>
User avatar
mixa2000
Forum Newbie
 
Posts: 18
Joined: Fri Jun 22, 2012 4:50 pm

Re: i have problem with slashes and quotes!

Postby mekha » Wed Aug 01, 2012 4:00 am

no no man, i know thats work....but i mean php & mysql ... sorry i forgot to say thant :crazy:
mekha
Forum Contributor
 
Posts: 112
Joined: Sat Mar 31, 2012 6:50 am

Re: i have problem with slashes and quotes!

Postby social_experiment » Wed Aug 01, 2012 4:31 am

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
social_experiment
DevNet Master
 
Posts: 2765
Joined: Sun Feb 15, 2009 12:08 pm
Location: .za

Re: i have problem with slashes and quotes!

Postby mixa2000 » Wed Aug 01, 2012 2:07 pm

Well yes you didn't mention about "php & mysql" that's why I answered it that way.
User avatar
mixa2000
Forum Newbie
 
Posts: 18
Joined: Fri Jun 22, 2012 4:50 pm


Return to PHP - Code

Who is online

Users browsing this forum: Bing [Bot] and 21 guests