Page redirection and referrer using Steam Authentication - php

I am relatively new to programming and have become stuck. I am unsure of what to call this (and what to search to find the answer) so if it is a duplicate or the answer can be found easily please forgive me.
So on my site I give a referral URL to users which is something like
www.example.com/referral.php/?id=1234
My problem comes from when someone visits my site with that link.
Once they click the enter that link and come to my server. They are then prompted to login through Steam servers and after that they are returned to my site with a URL which is something like this
www.example.com/referral.php?login&openid.ns=... it continues on for a while.
Is it possible to have them return to my site with this link?
www.example.com/referral.php/?id=1234
As it is what my site uses to register referrals.
Or is there some workaround possible such as I pull the id and put it on a cookie or something similiar on the first visit to the site.
Thanks for the help.

Related

Tracking visitors coming from Facebook

I have written a PHP based blog for the company i work for. Not using any frameworks. I am having trouble tracking users who come from my facebook page's posts to my blog (not wordpress).
I have created a shortlink url. Let's say it is sample.co and it redirects traffic to sample.com. Everything seems fine until here. The problem starts here.
I am adding all user's ip's, user agents. But if even i get 500 visits, my code adds somethig like 3.000 visits. Facebook stats and Analytics shows similar stats (~500 visits). I see that ip's added to MySQL are all different. It usually happens with Android users. I have read somewhere that Facebook sometimes renders to their users the actual URL when FB shows the post. I mean instead of the widget, Facebook shows the whole page. I am not quite sure about that to be honest.
To solve this problem, I have created and added an jquery script to my page and listened users' scroll event. It worked great. Not seeing too much traffic. But this time the problem is i am counting less users. Even I get 500 users from facebook and Analytics shows similar results, my script adds only 200-300 to MySQL.
Does anyone know a better way to track real traffic? Or do you aware of such problem?
Thanks
It should be filtered on the basis of user agent.
https://developers.facebook.com/docs/sharing/webmasters/crawler
how to detect search engine bots with php?
Identifying users through IP is a good idea, but if your IP keeps changing, it's a good idea to use cookies.
http://php.net/manual/en/function.uniqid.php
If the cookie does not exist, you should see it as a new user.
I have found the answer. The problem is called preview (prefetch). Here is the link:
https://www.facebook.com/business/help/1514372351922333
Simply, facebook preloads everything when FB shows the thumbnail to the visitor to speed up your page's load speed. They send X-Purpose: preview header. So you can simply check if HTTP_X_PURPOSE header's value is preview or not. If so, do not count it as a visitor.!
Here are more detailed descriptions:
http://inchoo.net/dev-talk/mitigating-facebook-x-fb-http-engine-liger/
http://inchoo.net/dev-talk/magento-website-hammering-facebook-liger/

Implement Facebook Login from ZERO

Hello and good day to everyone. I am new and I really need help about implementing facebook login on my website.
Let's start with what I understood.
1) I created a login page on my website (login.php), the code is the one found on fb developers page https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.3 (Quickstart section).
2) The login button works, when I click on it a pop up opens asking me to login on facebook and so on.
3) After I login i am redirected to logged.php (I added the redirect function)
4) Now I think I have to take the 1 data (username) used by that user with facebook and store it on my database just to create to him a profile on my website)
I have no idea how to do this last 4 step.
I am just familiar with PHP, (ASP), and easy java / css / mysql, so I am also having problems "writing" the script" but this doesn't matter now.
Can someone please tell me which code should I use on logged.php to take the username of the user (retrieved from facebook) ?
I just need to save it in a variable and then will handle with php, but the key point (my doubt) is how to take it from the facebook pop-up..
I hope I explained well my problem, I think is easy but I am not much familiar with any API (I just implemented API of youtube and the result is not that great) So any help may be appreciated.
Thanks again.

Facebook's l.php

So recently i gave my friend a URL on facebook chat while we were discussing on how much further we have to go on a booking system, my friend says he cant open the link, when i tried clicking it worked but what caught my eye was the referring URL by facebook:
https://www.facebook.com/l.php?u=https%3A%2F%2F192.168.42.149%2FIS314%2Freservations.php
I was intrigued by the l.php (L.PHP), what actually does l.php do? I googled and a author speculated something on privacy at this page http://www.codehesive.com/index.php/archive/facebook-privacy-and-the-mystery-of-l-php/ but nothing too certain. So i was wondering if anyone has a clear idea of what l.php could be, i find this interesting (weird i know). Thanks!
No one can know what exactly that script does but the developers at Facebook.
I presume they track all outgoing links from Facebook to get some statistics on them and on the users. After that it just sends you to the external page.
Please check out the following article Facebook, privacy and the mystery of l.php which says:
Unless it’s from a public page, all you’re bound to see is one simple
referring URL: http://www.facebook.com/l.php. Facebook ‘wraps’ all
links on Facebook within this simple file — once you click on a link
in Facebook, l.php will ‘redirect’ you to the actual URL. Why Facebook
does this is unclear.
So now you have more questions to answer.
Update: Sorry, I just realised that you posted actually the same link.

Facebook, check if user is a fan and logged in using PHP

I have searched the Internet and SO for over a week, but have not managed to find anything yet so allow me to ask a question which has already been asked loads of time on SO, but for which none of the answers seem to be working for me.
I have a website and a Facebook page. On my website I have the usual Facebook "Like me" box. As I want to show some extra content to my fans when they visit the website - and encourage non-fans to become a fan - I would like to know if it is possible, via PHP, to:
1. Understand if the user is a fan
2. Understand if the user is logged into Facebook
What I would like to be able to do is send a PHP request to Facebook and receive one of the following three answers: "is a fan", "not a fan", "not logged-in/not a Facebook user".
In the first case I would show the fan-only content, in the secon case I would try to encourage the user to become a fan, while in the third case I would not do anything as I'm not sure the user is a Facebook user.
Please note:
1. I do not need any further identifying information
2. There is no app involved here, as users are fans of my page, although I could build one if necessary
Some answers on SO seem to point to this tutorial, but as my page is not an app, I cannot really use this solution:
http://www.masteringapi.com/tutorials/facebook-api-check-if-a-user-is-fan-of-a-facebook-page/20/
Unfortunately Facebook's APIs won't tell you if the user's logged in or if is a fan of your page until you make the user install your Facebook app (and for the likes you will need user_likes permission too).
The only kind of exception is that when you are running a page tab. At the time facebook embeds your content via an <iframe>, the signed_request POST parameter that comes with it will tell you if the user is a fan or not. You can read about the signed request's here..

Post in a facebook app as my page?

I'm a little bit confused right now. But I think I'm making it more complicated than it is actually :) It's about posting out of a Facebook app. I have a Facebook page and I'm about to develop an app which should be integrated in that page. The purpose is to make the page more attractive and memorable. The app is about the content the page contributes. The problem is (I've alredy read some questions about that, but still I don't get it), if I post on a users' wall, I post as the app and not as the page.
It is possible to post on a users' wall after requesting their permission (publish_stream) and also on to post on a page the user administrates (manage_page). Am I right so far? But is there a way to post as my page within my app? Can I post as a one of my app users on a wall with any permission? I thought about if I start to use my app as my page, maybe then I can post as my page?
It may sound a bit awkward, but I hope anyone can help me. At least to tell me that I'm dreaming of something which wouldn't be possible anytime (because of security issues i.e.).
Thanks!
You cannot post as your page, users in your application can post to their walls or your applications page. In fact when building your app, if you are using Facebook as a page and try to refresh your App from your URL you will get errors... if you need help starting your app with the functions i have mentioned, visit this link: http://www.epixseo.com/index.php/facebook-php-3-3-1-and-javascript-sdk-graph-api-tutorial/

Categories