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
PHP Logging Error
When running the script on website it doesn't copy both input boxes, Only the user and not the passw
Logging and nologging bulk insert
Hi,
oracle version: 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
Read from a text file after a specific word
Hi all.
I have a text file that looks like the one below.
I know how to open the text fi
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
Async WSAConnect failed on XP with error code = 2 ("File not found")
Hi all,
I have very strange bug, please help me if you can.
It is reproduced o
Upload Code Help
Hi everyone I need some help with a bit of code ive been working with for a while. I am completely s
bit of help needed
Im about to sort out my registration page for my website by customising a "registration" s
Retreiving objects from Sessions
Hi all,
I am getting really frustrated with storing and retreiving objects from a session. Bu
Beginners syntax and loop questions - help please!
Hi everyone,
I have some problems with php code. I'm currently in the middle of learning php,
Am I setting up my sites oldschool?
Ok,
When I create a site I open a basic template that I have created that consists of a css f