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
22
Other forums
some questions
Hello,
I am looking for the answers for following questions:
1) Does PHP support overl
Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site
PHP error (line 38) my website
Hello everyone, I'm new on this
and I got a web site thats got a error not showing the photos on<
j1inmis Ouput layout changes
Hi,
Can anybody tell how can j1inmis output layout can be changed so that vendor names ge
convert static html data into dynamic
hi all
i need to convert a website which has static above 2000 articles into dynamic and add
want a code for uploading and downloading
i m trying to upload and download to my site..i need upload and download code ...i use a code for up
Bluetooth RSSI & VIsta
Okie I got 4 Bluetooth adapters, a DBT-120 by Dlink, A Zonet Microsoft Bluetooth which is what I use
How to give the privillege for triggers?
Hi,
How to give the privillage for triggers to particular user?
Please let me
first id from db not showing
I have a php script which displays the content of a mysql table as a html table with sorting, delete
Extracting Long text from message class with parameters
Hi,
I would like to extract the long text from a message class. However, the long text ha