Hi guys, please help me to remove the mb_strtolower function from a script. 1: There I enter a tag ex: Bigbang code: {input name='tags[]' type='autocomplete_list' ajaxFile='ajax_tagsList.php' id='tags' default_description=$default_description values=$wallpaper.tags} Code (markup): 2: script calls ajax_tagsList.php code: 3: Script display the tag as: bigbang code: This scrip is from a wallpaper site, the problem is when I add a tag ex: Bigbang the script will insert the word as "bigband" in mysql and displays at "bigband" I want to use capital letters in some tags, but i can't remove the .mb_strtolower function :/ any help would be greatly appreciated, thanks.
Cant you just use ucfirst("$string"); when displaying the tags? if you remove strtolower function all existing tags may break. http://php.net/manual/en/function.ucfirst.php
It seems like your script stores and reads the 'name' value via MySQL as lowercase. You can remove mb_strtolower() where the values are being stored so that they are stored into the 'name' field as they are typed in so that everything isn't lowercase automatically.
If you don't want it to change $_GET, store it in a variable for the places that need it changed and leave it alone where you want it 'mixed'... and why can't you just remove strtolower?!? Though... I know I shouldn't be too surprised at bad/insecure PHP when I see someone using smarty -- the two seem to go hand in hand... but... wow... You seem to be using some form of object based SQL, so why aren't you using prepared queries and instead seem to be blindly plugging in values to a string making the whole thing injection city? Goofy reverse quotes and string addition to build queries is decade out of date practices at best... Just what is that $db object because what you are doing with it is ... just wrong. Insecure, dangerous, just asking to be pwned. Also not sure why you're bothering with the object version of JSON with the detection since it would work either way with the just function...