Travis959 Posted November 13, 2010 Share Posted November 13, 2010 Hey guys, I have a script that attempts to call the database of my forums to find the last games played on each of their xbox live profiles. However when it attempts to call the image, it encodes the url - so http://tiles.xbox.com/tiles/tT/MX/0mdsb2JgbA9ECgQJGgYfVlpWL2ljb24vMC84MDAwIAABAAAAAP04M6o=.jpg turns into http%3A%2F%2Ftiles.xbox.com%2Ftiles%2FtT%2FMX%2F0mdsb2JgbA9ECgQJGgYfVlpWL2ljb24vMC84MDAwIAABAAAAAP04M6o%3D.jpg which makes the URL not work anymore so the script gives an error. I've tried urldecode() on numerous variables and it won't work. If I call the variable for the image on the page that submits the form it returns a normal address. Anyone have any ideas? Thanks! Link to comment https://forums.phpfreaks.com/topic/218545-how-to-keep-urls-from-getting-encoded-on-form-submittal/ Share on other sites More sharing options...
requinix Posted November 13, 2010 Share Posted November 13, 2010 Well, the "it encodes" bit needs to change, and how it would change depends on what it does right now. You... got anything to show? Anything more specific than "it"? Link to comment https://forums.phpfreaks.com/topic/218545-how-to-keep-urls-from-getting-encoded-on-form-submittal/#findComment-1133729 Share on other sites More sharing options...
Travis959 Posted November 13, 2010 Author Share Posted November 13, 2010 I'm not sure exactly what's doing the coding. Here's the php for the part I'm trying to call on the form page. $select2 = "SELECT lastplayed FROM gxboxlive WHERE gamertag = '$xboxliveid'"; $query2 = mysql_query($select2) or die (mysql_error()); while($list = mysql_fetch_object($query2)){ $lastxboxgames9 = $list->lastplayed; } $num = preg_match_all('!http://[^?#]+\.(?:jpe?g|png|gif)!Ui', $lastxboxgames9, $match, PREG_PATTERN_ORDER); for ($i = 0; $i < count($match); $i++) { $lastxboxgames = $match[$i][0]; $lastxboxgames = urldecode($lastxboxgames); } and here's the php for it on the actual script: $lastgames = urldecode($_GET['lastxboxgames']); I plan on having it show the last 5 games played eventually, but for now I'm just trying to get the most recent. Link to comment https://forums.phpfreaks.com/topic/218545-how-to-keep-urls-from-getting-encoded-on-form-submittal/#findComment-1133733 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.