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

My XSRF Prevention code isn't working
First of all, thanks for the generous help you guys have given me in the past on this forum.
Seco

mails going in spam??
The mails I sent to folks in my database using mail(function) are going in spam??

Any idea ho

Time script, set to my time zone?
I am using this line to get the date and time

Code: $time = date(F." ".d.", &q

[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.

If the program exits normally the por

listcube issue
Hi
I have a virtual cube ZREMOTE. I use Tcode "listcube" to retrieve contents. I use of the

array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I h

Multi Level Array Problem
hi all,

For example I have array like below:

$temp = array(array('north america', 'us'

Day of week
I am using PHP version 5.0.5
I have a varaible ($DATE (date format yyyy-mm-dd)) that is being inc

Detail Expenses Report by Cost Center
I would like to obtain a report out of SAP that shows a list of expenses by cost center that shows t

db entry based on primary key
My "topics" table contains 10 entires
*--------------*
topicid topic
------

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