General Community > Scripting Help

Quotes and backslashes

(1/1)

Peter Duggan:
When I test this script at my site, any single/double quotes or backslashes submitted as part of a boat's name come printed back to the browser escaped by backslashes, but the same names appear exactly as typed when I test it at home. Because of this, I suspect some difference in the configuration of my site and home PHP installations, but can anyone tell me more about what I should be looking for?

Parham:
the second comment here will help you Peter: http://ca.php.net/manual/en/function.stripslashes.php

Peter Duggan:
Thanks, Parham! 8)

Peter Duggan:

--- Quote from: Peter Duggan on September 19, 2003, 03:14:00 PM ---Because of this, I suspect some difference in the configuration of my site and home PHP installations...
--- End quote ---

So magic_quotes_gpc was on at petestack and off at home, which I'd have discovered quick enough anyway, but stripslashes() is what I really needed to know! :)

Parham:
You know what's really stupid of me... until only a little while ago, I didn't know slashes were automatically added because all the work I did was with databases.  It's only when I started using GD that I realized all input is escaped for security :)

Navigation

[0] Message Index

Go to full version