Jump to content

not using mysql_real_escape_string(), problem?


daydreamer

Recommended Posts

Is not using mysql_real_escape_string before putting strings into a mysql query a security problem if you apply the following steps before:

 

1. take out all ' and ".

2. apply stripslashes();

3. apply http://uk2.php.net/manual/en/function.addslashes.php

4. put the string between apostrophes:

 insert into table set column='user entered string'

 

Thanks any opinions appreciated

 

 

Link to comment
Share on other sites

I agree and prefer to use mysql_real_escape_string, but a site I am working on has their own escape function, that also replaces ' and " so that if data is taken out, processed in some way and then put back into a table (if it contained a ') it will not have to be escaped again.

 

I just wondered how secure it is.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.