0

i'm working on project that some people can make post

and this post can have a code like php css html javascript ect

how can i insert php and another programming code to my database without any effect

(i mean by safety )

for me i'm using pdo with mysql database

i tried to upload the code to my database and when i fetch the information my html and css page changed to something else like what i upload from css

and i dont know if there was any php effect for this.

again what i mean is something like what stack-overflow use for to secure his database when we insert code to our post

is there is any library or something that i don't know ?

thank you soo much :)

badr aldeen
  • 438
  • 6
  • 20

1 Answers1

-1

for php code there is no problem after fetching the code if you are using pdo prepared it wana be just like any value you echo it

for the other hand you can use echo htmlspecialchars()

Abomusab Revo
  • 78
  • 1
  • 14