Share Social To Unlock Download Link using javascript

Oct-23-2014 in jQuery, PHP No comments

Today I will explain how to request visitors to share links before appear the download link. You can increase the visitors from social networking and more people can know to your website.

To do Share To  Download Link you need:

First we need to create a facebook app, or you have the facebook app, we need a facebook app “id”. because the code we provide below requires the facebook app “id”.

Let’s start! we go to http://developer.facebook.com

Step 1:You can see the top menu click to ”App -> Add a New App”.

create facebook app step1

Step 2:You click on the image “WWW” -> Choose an existing app or type the name of your new app -> Skip Quickstart.

create facebook app step2

Step 3:You click Settings tab and in App Domains enter root domain(Ex: domain.com non www or subdomain), Site Url enter domain name with “/” then click click to Save Changes.

Now that we have completed the steps to set up a facebook application.

Next you should insert it directly after the opening <body> tag:

Above code allows you to connect facebook, followed by the function ShareSocialToDownloadLink() check if user shared on facebook.

Creating page redirect_link_to_download.php: this page very simple. You add the following code and save.

No Responses

Add Your Comment