Jump to content

How to keep url's from getting encoded on form submittal


Travis959

Recommended Posts

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!

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.