str_replace help


Posted on 16th Feb 2014 07:03 pm by admin

I am thinking str_replace is my only option to filter outputs from my database to convert them to safe url variables.

I am working with a database with over 4million records, and apparently when the database was created no one though about database safety, or site safety or I don't think much in general.

So that said in the database I have characters like & ' " etc.. stuff that most people will sanitize in one way shape form or another and store as such. I guess with this post I am trying to find out what are the most important characters such as above mentioned that I should attempt to filter out, or filter differently. I am also using some of these variables within URL's so its important that I can pass them through URL variables.

The urls are being phased in 2 ways one, your standard long url (ie: index.php?a=var&b=var&c=var) and then a more SEO friendly version /a/var/b/var/ in either event I cant have ' " & other in the URLs they just dont work. For other reasons I cant have them just output in the code. So what ever characters i need to filter out and what I should filter them out as that as, as in what would you suggest to phase them as? Anything that could break code, or not work in a URL I need to know.

Also if anyone knows a better way to do it than str_replace("&", "What to replace"); ill take advice there too :-)

No comments posted yet

Your Answer:

Login to answer
141 Like 22 Dislike
Previous forums Next forums
Other forums

Create multiple (n) arrays
Hi there,

I have the following need:

I have 2 arrays (coming from a databases)

Price in PR
Dear Experts,
Why we have to enter the price in the PR, and why there is no free goods indicato

Get dump of MySQL DB from Live Site
I'm after an easy, but secure way of generating and importing a MySQL dump from a remote server.

ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al

Image loading
Hi Developers,

I'm trying to display an image from images/image.gif getting the url from mysq

Retrieving Data from Two Different Databases
Hello All,

Ran into another problem and would appreciate some help! I have two datab

Transaction variant for VA02 not working
My requirement is to have transaction for user to only add the output and print a sales order.

$variable $variables type question
I need to be able to designate an array element dynamically, so I thought to use a variable variable

Disable html within defined tags
I have a mysql database that allows users to enter content with html, but I also want to have a tag

passing data from one page to another
hey guys
i have the follwoing code to get information from one page and place on another:

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash