Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove apostrophe ' from comments input field


DogFoodIT

Recommended Posts

Hi all, just need to strip an apostrophe from the comments field before final submittion

 

i have tried a few things, this is one of them;

 

str_replace("'","",$HTTP_POST_VARS['comments']);

 

still not working!

 

any help would be appreciated.

 

Thanks

 

Ben

Link to comment
Share on other sites

Hi all, just need to strip an apostrophe from the comments field before final submittion

 

i have tried a few things, this is one of them;

 

str_replace("'","",$HTTP_POST_VARS['comments']);

 

still not working!

 

any help would be appreciated.

 

Thanks

 

Ben

You shouldn't have to do that, assuming you're talking about the stock oscommerce code. If you do need to change it, you need to use the tep_db_prepare_input function to apply the field to a variable and then tep_db_input when adding it to the database. Otherwise it is a security hole.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...