TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-30-2008, 06:23 PM   #1 (permalink)
The Contributor
 
Join Date: Apr 2008
Location: Nevada, USA
Posts: 52
Thanks: 10
h0ly lag is on a distinguished road
Default $_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.
Send a message via AIM to h0ly lag Send a message via MSN to h0ly lag
h0ly lag is offline  
Reply With Quote
Old 05-30-2008, 06:28 PM   #2 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

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
delayedinsanity is offline  
Reply With Quote
Old 05-30-2008, 06:31 PM   #3 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

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
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 05-30-2008, 06:33 PM   #4 (permalink)
The Contributor
 
Join Date: Apr 2008
Location: Nevada, USA
Posts: 52
Thanks: 10
h0ly lag is on a distinguished road
Default

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']);

Last edited by h0ly lag : 05-30-2008 at 08:31 PM.
Send a message via AIM to h0ly lag Send a message via MSN to h0ly lag
h0ly lag is offline  
Reply With Quote
Old 05-30-2008, 06:45 PM   #5 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

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
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 05-30-2008, 07:22 PM   #6 (permalink)
The Contributor
 
Join Date: Apr 2008
Location: Nevada, USA
Posts: 52
Thanks: 10
h0ly lag is on a distinguished road
Default

I am scraping the data from Bungies website.
Send a message via AIM to h0ly lag Send a message via MSN to h0ly lag
h0ly lag is offline  
Reply With Quote
Old 05-30-2008, 08:26 PM   #7 (permalink)
The Wanderer
 
Join Date: May 2008
Posts: 10
Thanks: 0
Folio is on a distinguished road
Default

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 '&nbsp'?
Folio is offline  
Reply With Quote
Old 05-30-2008, 08:30 PM   #8 (permalink)
The Contributor
 
Join Date: Apr 2008
Location: Nevada, USA
Posts: 52
Thanks: 10
h0ly lag is on a distinguished road
Default

It's already working.
__________________
Send a message via AIM to h0ly lag Send a message via MSN to h0ly lag
h0ly lag is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:35 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design