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
$_GET problem
Hi all,
Have a bit of a problem with a little piece of code, I am not sure if this should be
empty() error
Why does
Code: empty($USER_ID = $_SESSION["USER_ID"])
create this error...
MFC GUI Programming
I am working on a project right now that requires me to create a MFC Windows GUI. Basically it need
user administration
Dear @all,
what I have to do to set the user defaults for new users. At the moment I woul
Procedural to OOP
John Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pr
Tournament Brackets (Double Elimination)?
Is making a double elimination tournament style bracket system capable of being done in php?
Log $_POST
How would i log submits on a form, by everyone? I want to then echo the number of submissions.
MySQL Primary key gap
Alright, so I have a table with 26 entries in it (id, filename, caption) for my image randomiser (ht
Problem with PHP code- simple contact form
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a contact form wit
bind error during socket programming
i am kinda new to socket programming. wrote the below code for a server. but getting the bind error