IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Suggest Function For This Work...
Piyush
post Nov 3 2009, 01:34 PM
Post #1


Newbie
*

Group: Members
Posts: 23
Joined: 6-September 09
From: India
Member No.: 33,611
Languages: Javascript,PHP, ASP, HTML



Please function for this work...
it inputs and removes all the "\" coming before ' or "
for eg...
input----(\' string...)
should return...('string...)
Go to the top of the page
 
+Quote Post
Ingolme
post Nov 3 2009, 01:55 PM
Post #2


Duotone Fox
*****

Group: Members
Posts: 3,585
Joined: 6-November 07
Member No.: 18,212
Languages: (X)HTML, CSS, Javascript, PHP, SQL, XML [DOM].



Are these slashes appearing automatically in your strings? It sounds like you have a server with magic quotes activated.

The stripslashes() function removes slashes from special characters.

This post has been edited by Ingolme: Nov 3 2009, 01:55 PM
Go to the top of the page
 
+Quote Post
Piyush
post Nov 3 2009, 06:50 PM
Post #3


Newbie
*

Group: Members
Posts: 23
Joined: 6-September 09
From: India
Member No.: 33,611
Languages: Javascript,PHP, ASP, HTML



yes these were automatically generated..how to stop this...
and thanks for the function
Go to the top of the page
 
+Quote Post
RahXephon
post Nov 3 2009, 06:57 PM
Post #4


Living under a rock.
***

Group: Members
Posts: 709
Joined: 24-January 06
From: 612 Wharf Avenue
Member No.: 2,173
Languages: XHTML, CSS, JavaScript, PHP



Ingolme just told you how. Use
CODE
stripslashes()
Go to the top of the page
 
+Quote Post
justsomeguy
post Nov 3 2009, 07:08 PM
Post #5


The Old Man From Scene 24
*******

Group: Moderator
Posts: 14,826
Joined: 17-April 06
From: Phoenix
Member No.: 4,190
Languages: Focusing on PHP and JavaScript



If you want to stop it from happening in the first place then set the magic_quotes_gpc PHP option to off.

http://www.php.net/manual/en/info.configur...agic-quotes-gpc

You can only set that option inside an htaccess file or php.ini file, using ini_set at runtime on that option doesn't do anything.
Go to the top of the page
 
+Quote Post
Piyush
post Nov 3 2009, 07:12 PM
Post #6


Newbie
*

Group: Members
Posts: 23
Joined: 6-September 09
From: India
Member No.: 33,611
Languages: Javascript,PHP, ASP, HTML



thanks magic_quotes_gpc worked....
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd November 2009 - 06:04 AM