karimali831 Posted March 28, 2010 Share Posted March 28, 2010 <option value="clans&action=clanregister&clanID='.$dm['clanID'].'">'.getclanname($dm['clanID']).'</option> Browser output: clans%26action%3Dclanregister%26clanID%3D325 any ideas? :confused: Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/ Share on other sites More sharing options...
Brandon_R Posted March 28, 2010 Share Posted March 28, 2010 You need to run urldecode() on the variable. Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/#findComment-1032965 Share on other sites More sharing options...
karimali831 Posted March 28, 2010 Author Share Posted March 28, 2010 Can you show me how I can do this please? Never used it before. Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/#findComment-1032966 Share on other sites More sharing options...
oni-kun Posted March 28, 2010 Share Posted March 28, 2010 urldecode A browser would output URL encoded (escaped) characters for compatibility. $uri = 'clans%26action%3Dclanregister%26clanID%3D325'; print urldecode($uri); Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/#findComment-1032968 Share on other sites More sharing options...
karimali831 Posted March 28, 2010 Author Share Posted March 28, 2010 OK, I did this with no luck $uri = 'clans%26action%3Dclanregister%26&cupID%3D'.$dl['ID'].'%26clanID%3D'.$dm['clanID'].''; print urldecode($uri); $clan .= '<option value="'.$uri.'">'.getclanname($dm['clanID']).'</option>'; Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/#findComment-1032970 Share on other sites More sharing options...
oni-kun Posted March 28, 2010 Share Posted March 28, 2010 For one you have two ampersands. register%26& Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/#findComment-1032972 Share on other sites More sharing options...
karimali831 Posted March 28, 2010 Author Share Posted March 28, 2010 Yh I noticed that, now I am getting this all over the page (repeating) clans&action=clanregister&cupID=24&clanID=325.$uri.">Team -X1-clans&action=clanregister&cupID=24&clanID=353.$uri.">fabricclans&action=clanregister&cupID=23&clanID=325.$uri.">Team -X1-clans&action=clanregister&cupID=23&clanID=353.$uri.">fabricclans&action=clanregister&cupID=22&clanID=325.$uri.">Team -X1-clans&action=clanregister&cupID=22&clanID=353.$uri.">fabricclans&action=clanregister&cupID=21&clanID=325.$uri.">Team -X1-clans&action=clanregister&cupID=21&clanID=353.$uri.">fabricclans&action=clanregister&cupID=20&clanID=325.$uri.">Team -X1-clans&action=clanregister&cupID=20&clanID=353.$uri.">fabricclans&action=clanregister&cupID=19&clanID=325.$uri.">Team -X1-clans&action=clanr I need it to printe decode it on value = <option value="'.$uri.'"> any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/#findComment-1032975 Share on other sites More sharing options...
karimali831 Posted March 28, 2010 Author Share Posted March 28, 2010 You can not decode URL on a option value for a dropdown? Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/#findComment-1032976 Share on other sites More sharing options...
oni-kun Posted March 28, 2010 Share Posted March 28, 2010 I set print so it'd show you it works. This should work (on my previous example), replace the respective print line with this: $uri = urldecode($uri); Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/#findComment-1032978 Share on other sites More sharing options...
karimali831 Posted March 28, 2010 Author Share Posted March 28, 2010 $uri = 'clans%26action%3Dclanregister%26cupID%3D'.$dl['ID'].'%26clanID%3D'.$dm['clanID'].''; $uri = urldecode($uri); $clan .= '<option value="'.$uri.'">'.getclanname($dm['clanID']).'</option>'; Thanks for your help... but still no luck with the above code It does decode but not from option value? Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/#findComment-1032980 Share on other sites More sharing options...
oni-kun Posted March 28, 2010 Share Posted March 28, 2010 It works for me. Why not var_dump $uri and see what's missing? Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/#findComment-1032981 Share on other sites More sharing options...
karimali831 Posted March 28, 2010 Author Share Posted March 28, 2010 Can you show how I can do this? when you select : <option value="'.$uri.'"> It will open $uri = 'clans%26action%3Dclanregister%26cupID%3D'.$dl['ID'].'%26clanID%3D'.$dm['clanID'].''; $uri = urldecode($uri); and show as clans%26action%3Dclanregister%26cupID%3D21%26clanID%3D325 so it don't work on dropdown Quote Link to comment https://forums.phpfreaks.com/topic/196764-wierd-characters-really-confused/#findComment-1032997 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.