I am having a problem passing a variable because that variable is something like this:
url=http://targetsite.com/redir.php?did=21887116&rv=a1443d33464
...and it has a "?" already in there. Does this cause problems?
I ask because it gets sent to a redirect page and the url looks like this:
http://www.mysite.com/red.php?url=http://targetsite.com/redir.php?did=21887116&rv=a1443d33464
This is passing the variable 'url' but it also has another '?' later on in the string.
Will this cause a problem?
yes it will cause a problem.
http://uk.php.net/manual/en/function.urlencode.php http://uk.php.net/manual/en/function.urldecode.php
😉
Ok, is there a solution to get around this problem?
Up ^
Posted simulataneously!
I am trying this...
echo "<span class='nx-title'><a href='../red.php?url= '.urlencode({$ad['CLICKURL']})'>{$ad['TITLE']}</a></span></br>";
But its not quite working. What is wrong with my syntax?
$url = urlencode($ad['CLICKURL']); echo "<span class='nx-title'> <a href='../red.php?url=" . $url . "'>" . $ad['TITLE'] . "</a></span></br>";
I think. 😉
Rofl, edited 6 times...
When I use your code and hover over the link, it shows '?url=' and then nothing after it. Any ideas why?
Just tried this and it works...
echo "<span class='nx-title'><a href='../red.php?url=".urlencode($ad["CLICKURL"])."'>{$ad['TITLE']}</a></span></br>";
Hmm, it worked for me....