Thanks Robert. Learned something new. Not sure why Facebook is doing that. I am using Jquery Mobile and the anchor broke the page so I ended up with a blank page. This fixed the problem.
var curl = window.location.toString();
if (curl.indexOf('#_=_') > 0 ) {
var newval = curl.replace(/\#\_\=\_/,'');
window.location = newval;
}
On Saturday, March 31, 2012 10:45:17 AM UTC-6, Robert Gonzalez wrote:
Because the server doesn't see the anchor or anything beyond it. The anchor is for the client, as is demonstrated by the actions taken on the client when clicking a link that points to an anchor. There is no post back because the request is handled in the client.
Make sense?
A simple test for this would be to create a PHP script (called request.php for example) with this code in it:
<?php
var_dump($_SERVER['REQUEST_URI']);
You'll see that it picks up everything up to the anchor.
I have been integrating Facebook to authenticate my app. I have all working well except for some strange reason, when FB redirects to my URL it adds #_=_ at the end of my URL. I first thought I could fix this in PHP and redirect but the characters do not show up in any of the $_SERVER elements. I ended up having to use javascript to fix the problem. Just wondering why I couldn't do it in PHP?
Thanks.
--
This group is managed and maintained by the development staff at 360 PSG. An enterprise application development company utilizing open-source technologies for todays small-to-medium size businesses.
For information or project assistance please visit :
http://www.360psg.com
You received this message because you are subscribed to the Google Groups "Professional PHP Developers" group.