/    Sign up×
Community /Pin to ProfileBookmark

Redirection from external website

Hello,

I’m developing a website that contains a store with a PayPal shopping cart. When users want a file, they are redirected from my site to PayPal to purchase the file. When the transaction is complete, they are redirected back to my website.

As soon as they come back to my site, they come to a “splash” PHP file, which redirects to another PHP file that prompts the download of the purchased file.

I ONLY want the redirection from the “splash” file to the download file to happen if the user was redirected from Paypal. That is, if they copied and pasted the “splash” file into the browser, the download should not start.

I got a bit of help with this elsewhere and I started using sessions, but I got stuck. I don’t even know if sessions is the right way to go anymore.

Any help is greatly appreciated. Thank you.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJun 13.2017 — While in theory you could use the $_SERVER['HTTP_REFERER'] value, it's not required that the browser send it, and it could be spoofed.

Personally, I'd start by looking at the PayPal API/Documentation and see what it sends in it's response/request that you can use.
Copy linkTweet thisAlerts:
@mmoore25authorJun 13.2017 — Okay. Thank you. I've been corresponding with the integration team at PayPal but they haven't really been forthcoming with any information that would help me. i know in my heart of hearts what I want done can be accomplished because I've seen it done on other sites, but I may just have to find another way. Any suggestions?
×

Success!

Help @mmoore25 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...