Unstoppable Domains โ€” Expired Auctions

Another PHP problem

SpaceshipSpaceship
Watch

TwiztedFake

Established Member
Impact
1
I'm writing my first major site using a database and php. Of course I keep running into things I don't know yet. So here is my latest problem. I'm working on an article submission and get an error anytime there is a ' , " : ; and other common punction. I know I need to do something in the processing part of the code.

Help please?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
put a \ infront of each special character.
 
0
•••
if the error is occuring when you try and input them into the database you can use mysql_real_escape_string() if you are using mysql (there are similar functions for other databases)

In addition if the string is to be displayed on a web page then you could also run it through htmlentities() which will stop the browser processing any html instead of displaying it.
 
0
•••
put a \ infront of each special character.

That doesn't solve the problem when I'm using an input field that members will be able to write in. I use that in my hard coding of course to take care of situtaions like I stated on my side. I can't expect members of my site to put \ in front on all special characters when the type up an article.

if the error is occuring when you try and input them into the database you can use mysql_real_escape_string() if you are using mysql (there are similar functions for other databases)

Thats what I was thinking but thought there might be a better way of doing it. Thanks for the help guys.
 
0
•••
Yeah you just need to escape the string or convert those characters to XHTML entities.
 
0
•••
CatchedCatched
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