close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Restict page view based on incoming URL

Thread began 2/09/2014 7:56 pm by Christopher West | Last modified 2/10/2014 8:35 am by Jason Byrnes | 1144 views | 3 replies |

Christopher WestCommunity Expert

Restict page view based on incoming URL

Hi, I am creating a competition page for website, the client wishes this page to only be viewable based on the link that the affiliate website would place on their website....Now the way I see this could happen is if I store the affiliate website in my database that contents the competition details. Now my question...how can I do a check based on URL that was the address that took the customer to my page?

Chris

Sign in to reply to this post

Jason ByrnesWebAssist

the incoming links should contain an affiliate ID as a URL variable:

yourpage.php?afid=1234

or:
yourpage.php?afid=5678


you can then create an if statement that compares the URL Variable
<?php
if(isset($_GET['afid']) {
if($_GET['afid'] == "1234") {
<do something here>
} eleseif($_GET['afid'] == "5678") {
<do something else here
}
}
?>

Sign in to reply to this post

Christopher WestCommunity Expert

Hey Jason, thanks for that, one question though I would also like to include in the IF condition for the incoming domain name.

for example lets say I create a competition page with the competition id (so that I can create multiple competitions for different websites that are all separate)

example lets say I create w competition for webassist.

I would then provide webassist a link www.mydomain.com/Competition.php?CompetitionID=1

WebAssist would then put this link up on their website somewhere so theu users can then click on the link and enter the competition....
..HOWEVER...lets say Adobe.com find this link on WebAssist website and then copy the link and place it on their website...I don't want this allowed...so the only way is to do an IF condition based on the incoming URL so that I make sure that for that particular competitionID that it checks for the webassist domain and accepts any visitors incoming from that domain.

Chris

Sign in to reply to this post

Jason ByrnesWebAssist

i believe you can get the incoming domain name using:

$_SERVER["HTTP_REFERER"]

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...