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.
Did you know?Explore Trending and Topic pages for more stories like this.
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
Points for Wiki contribution
Hi everyone,
I want to know how long does it take for the moderator to award points for a
Wierd if else problem
Hi guys,
this probably aint wierd for you, but it seems like php is playin up to me. may b i
Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,
help with email script...
hey
I need help with my mail script
when the form on http://www.mcgdesignstudio.com/c
SQL query not working well
Hi,
I made a small table with 5 rows and want to make them an sql consult using rownum
split values
I have values that are returned to me in this format:
name=>test,age=>49
Trigger tag in aspx is not coming
hi all ,iam new to ajax, iam using file upload inside the update pannel but right now i want to use
Open browser page depending on XML results
Hello,
I have some PHP code that sends webbased from data to an external url ( in the form of
Problem with umlauts and UTF-8
Hello every1,
I'm creating my own little CMS at the moment and got some problems with the cha
Adding Outlook 2007 items via file upload
I am looking for a way to be able to attach an Outlook item (an email message) in an ASP.NET 3.5 app