I am working on a CiviCRM plugin that will act as a unified solution for social media login.

Once someone clicks the Login button which this plugin adds (eg to an event page), he or she is redirected to a new page for further data exchange (eg login on Twitter, Google+ etc).

Is there a way I can get to know from which the button was clicked?

One way is to store the same while clicking the button or send it to the new page as a GET or POST variable. I just wanted to check if we already storing/getting it up somewhere in CiviCRM.

  • What login button?
    – Coleman
    Jul 7, 2015 at 0:44
  • Which CMS are you using?
    – davejenx
    Jul 7, 2015 at 9:02
  • Can you tell a little more about what you are trying to accomplish with knowing where you come from? That might help us all to provide you with options? Jul 7, 2015 at 10:53
  • Sid - it might help to add documentation to the README on Github which illustrates your intended flow, as well as the features you're aiming to implement. Did we discuss that a few weeks back? Maybe it's in email or something instead of on Github? Jul 7, 2015 at 21:33

2 Answers 2


This sounds similar to a payment processor flow (especially the "button" style processors). In those, you typically pass a "return URL" to the remote site, and they would in turn direct your visitor back to the specified URL.

If the return URL needs to be a separate callback (eg an IPN URL), then you might add additional parameters (&return=civicrm%2Fevent%3Fid%3D1%26reset%3D1) to the IPN URL, and the IPN can in turn decode that (civicrm/event?id=1&reset=1) and perform a final redirect to land the user on the page they originated from.


Can you use the superglobal? That is, $_SERVER['HTTP_REFERER']?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.