How can we automatically escape incoming data?

We have to enable the Magic quotes entry in the configuration file of PHP.