Unstoppable Domains โ€” Get your daily AI drops report

PHP, removing \ before

SpaceshipSpaceship
Watch

CHR15B

Established Member
Impact
0
In my PHP script (very basic) everytime an apostrophe is entered, when displayed a \ appears before it automatically, is there any way to fix this so it won't happen?

Chris
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
0
•••
So if I put this at the top of the script, whenever a user enterers a message like

Hi I'm John, it'll display as that, instead of Hi I\'m John
 
0
•••
I can't say what it would do without seeing the code itself. Are you pulling values from a database? You're welcome to post the code or a snippet here.
 
0
•••
Ah, I managed to get it working, it was to stop it happening in submitted comments, I just added $comments=stripslashes($comments); and it worked, cheers buddy!
 
0
•••
Slashes remind me of SQL Injection :">

-Pratik
 
0
•••
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back