Solved

referer from domain

Posted on 2006-10-19
1
258 Views
Last Modified: 2008-02-01
hello,
how can I make something so that if user comes from
domain.com, domain.com/test/ and domain12.com
display hello 2 otherwise display hello 4

<?
$referer = $_SERVER['HTTP_REFERER'];
if (strstr($referer, "domain.com") !== false) {
   echo "hello 2";
}  
 else{
   echo "hello 4";
}
?>
0
Comment
Question by:Sabrin
1 Comment
 
LVL 16

Accepted Solution

by:
hankknight earned 500 total points
ID: 17767938
Try:

<?
$referer = $_SERVER['HTTP_REFERER'];
if (strstr($referer, "domain.com") !== false ||  strstr($referer, "domain12.com") !== false || strstr($referer, "domain.com/test/") !== false) {
   echo "hello 2";
}  
 else{
   echo "hello 4";
}
?>
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Build JSON from table records 17 40
Phone Dialer 5 36
sql sentence 2 12
Adding through query php 9 8
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now