help with i guess easy $_GET function

Hello im trying to make a redirect page but its not working very well… and i need some help…

http://www.tibiamaps.org/redirect.php?url=http://www.tibia.com/news/?subtopic=newsarchive&id=2097

that is the one and as you can see…

Your heading to: http://www.tibia.com/news/?subtopic=newsarchive

it dosnt grab the full url it skips the &id=2097 but i dont want it to do that
this is the code i’m using
btw im terrible at php

[php]<?php
header(‘Content-Type:text/html; charset=UTF-8’);
$url = $_GET[‘url’];
?>[/php]

i need help to fix this.
thanks in advance

You can’t use two “?” in a url. So this:

http://www.tibiamaps.org/redirect.php?url=http://www.tibia.com/news/?subtopic=newsarchive&id=2097

Would need to be this:

http://www.tibiamaps.org/redirect.php?url=http://www.tibia.com/news/&subtopic=newsarchive&id=2097

Then, you would need to pull it this way:

$url = $_GET[‘url’] . “?subtopic=” . $_GET[‘subtopic’] . “&id=” . $_GET[‘id’];

Or something like that… Just typed it off the top of my head… The thing to remember is that when you read the posted arguments from the original url, the “?” and “&” no longer show up in your url. They are posted or passed to the code. So, you can use them, but, you must rebuild the url for another use. It would be good to first display the $url after you build it for testing. Hope that helps!

http://www.tibiamaps.org/redirect.php?url=http://www.tibia.com/news/?subtopic=newsarchive&id=2097

replace & with %26

Sponsor our Newsletter | Privacy Policy | Terms of Service