suzie Posted September 29, 2010 Share Posted September 29, 2010 Dear Friends,On our website we have the facebook button to let the visitors share the article on facebook....the link to share is in this form:http://www.annahar.com/new-website/content.../$type/dayafter sharing it, when click on the shared link it opens in this form, so it seems that it understands the forward slash as %2F, it encode ithttp://www.annahar.com/new-website/content...#036;type%2FdayWhat shall I do in this case..please help Link to comment Share on other sites More sharing options...
justsomeguy Posted September 29, 2010 Share Posted September 29, 2010 That's fine, it's correct to encode that character in a URL. Link to comment Share on other sites More sharing options...
suzie Posted September 30, 2010 Author Share Posted September 30, 2010 Ok, but in this way with this URL:http://www.annahar.com/new-website/content...#036;type%2Fdaythe page will not be displayed.....But only in this way the page will be displayed:http://www.annahar.com/new-website/content.../$type/dayso what to do if I don't want this character to be encoded??thanks a lot Link to comment Share on other sites More sharing options...
justsomeguy Posted September 30, 2010 Share Posted September 30, 2010 For me it's the other way, with the %2F it gets displayed, but not with the slashes.If the browser is automatically encoding those characters before it sends the request to the server then you can't really stop it from doing that. If this is going to URL-rewriting, then you can either change the rules so that it also looks for %2F in the request in addition to the slash, or you can change the character to something other than a slash and have it look for that instead. Link to comment Share on other sites More sharing options...
suzie Posted October 6, 2010 Author Share Posted October 6, 2010 Thanks a lot for your replythe way am using to look about the slash and separate the URL is :if (!empty($_SERVER['QUERY_STRING']) ) { $q = $_SERVER['QUERY_STRING']; $pairs = explode ('/', $q); $len = count($pairs); for ($i = 0; $i < $len; ++$i) { list($a, $ = explode('/', $pairs[$i]); $_GET[$a] = $b; }} $table = $pairs[1]; $type = $pairs[2]; $priority = $pairs[0];So please, is there a way to let it explode for the slash and the %2F at the same time??thanks a lot Link to comment Share on other sites More sharing options...
justsomeguy Posted October 6, 2010 Share Posted October 6, 2010 Well, the server should actually do that conversion. The URL says %2F, but I believe that PHP should translate that back to a slash when it reads it. Maybe I'm wrong, I could be thinking about something else. If it doesn't do it automatically, you can do it yourself with this:http://www.php.net/manual/en/function.urldecode.php$q = urldecode($_SERVER['QUERY_STRING']); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.