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
Thread in PHP
Thread in PHP
Some basic use and basic code for thread in php
This is my question?
How to submit a form to the same page?
I have a table containing information about books in my library and this table has the following col
Secure pages Sessions vs. Cookies & session_destroy() help
Im new here and new to PHP, I hope you can help me with some questions.
Im writing my web ap
Strange array issue, never happened before.
mysql_fetch_array returns 1 array per call. Generally that's why it is inserted into a while statem
Can't find the problem (no error message)!
OK, here's the deal. This code is really weirdly formatted (sorry!) and hard to understand, so I'm g
Session login issue
I'm wondering how to fix a problem I'm having with a session-based login system
Say I go to h
can i optmize image to 50% quality before uploading 2 server
Hi there
i have jus written a php program to upload and display images but when i try to uplo
PHP hyperlinks generator
Hi
I need some help to get this done using php:
1 - I have few hyperlinks say 500
Something like an INI editor or a DelimitedText-Editor
Hi all,
Am very, very, very new to PHP and not sure if I should be posting this to a Javascri
A rank users order by points
I want to make an insert from table 'rank' , with number (rank) from the cod blow, to fild users.ran