![]() |
$_GET and spaces
So I have coded a nice little Halo 3 stats sig but I'm having troubles with it getting the stats of gamertags with spaces in them.
This works: http://lagnet.org/stats/Shishka.png This doesn't: http://lagnet.org/stats/TJ Scoot.png I've Googled around for a little bit, but to no avail. Oh and adding %20 doesn't do a damn thing either. |
I'm not sure what your code is doing, just what it's outputting, but I would suggest substituting spaces for something such as underscores, and using str_replace or your tool of choice to swap them in and out as needed.
-m |
how does your code grab data for the tag? whats the site url.
pardon my ignorance in this, i have little to no clue about gamertags |
Mmk, would this work?
$gt = str_replace(" ","-",$_GET['gt']); EDIT: I also forgot to mention I'm using mod_rewrite and that the actual URL is /stats/stats.php?gt=Gamertaghere @sketchMedia I posted working links in my post. EDIT2: Thanks delayedinsanity, str_replace worked perfect. I ended up using this: $gt = str_replace(" ","+",$_GET['gt']); |
my question remains unanswered, how did you get the DATA for the image? i dont want to see the end result, i was assuming that you either screen scraped or found an api from microsoft to grab the data thus my initial thought that it could be a problem in how you were requesting data from that web service.
edit: sorry if that sounds obnoxious, but i have a headache and tend to behave like a bear with a sore head xD |
I am scraping the data from Bungies website.
|
urlencode() may help you here for decoding what is passed in the url or what you are adding to the url
did you try replacing the spaces with ' '? |
It's already working.
|
| All times are GMT. The time now is 02:23 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0