Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #9903

$referrer = $_SERVER['HTTP_REFERER'] echo

From Twayne <nobody@spamcop.net>
Newsgroups comp.lang.php
Subject $referrer = $_SERVER['HTTP_REFERER'] echo
Date 2013-06-27 17:23 -0400
Organization Aioe.org NNTP Server
Message-ID <kqiah2$5r6$1@speranza.aioe.org> (permalink)

Show all headers | View raw


I have what's probably a simple and very basic question.

My goal is to see where a visitor sending a form-email with mail() on 
win 7 and XAMPP - PHP 5.3.5, came from. e.g. did he come here from the 
right page or just barge into this page as his landing page?
   My php.ini seems to be OK and I've not changed any other config 
files. All other "If's" work OK and I'm now baffled.

This works fine:
-------------------
$referrer = $_SERVER['HTTP_REFERER'];
echo "<br /><br /> Visitor came here from : ". substr($referrer, -13, 
13)."<br />";
------------------

But this will not work:
------------------------------
if(substr($referrer, -13, 13))==="formcheck.php") {echo "Something 
showed up";
}
-----------------------------

It results in the following error:
------------
Parse error: syntax error, unexpected T_IS_IDENTICAL in 
C:\xampp\htdocs\formcheck2.php on line 36
------------
when when run on my local XAMPP Server.

I have tried everything I can think of to get it to work: Interchaning 
the vars on each side of "===", using "==",  moved the closing parens 
around, with and without curly brackets, etc. etc. etc. I've got myself 
so confused now I feel really stuck.

Can anyone straighten me out?

TIA,

Twayne

Back to comp.lang.php | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

$referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-27 17:23 -0400
  RESOLVED Re: $referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-27 17:34 -0400
  Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-27 23:40 +0200
    Re: $referrer = $_SERVER['HTTP_REFERER'] echo Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 00:19 +0200
      Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-28 02:16 +0200
        Re: $referrer = $_SERVER['HTTP_REFERER'] echo Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 10:56 +0200
          Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-28 20:03 +0200
            Re: $referrer = $_SERVER['HTTP_REFERER'] echo Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 21:49 +0200
              Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-28 22:37 +0200
                Re: $referrer = $_SERVER['HTTP_REFERER'] echo Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 23:55 +0200
      Re: $referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-28 13:49 -0400
        Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-28 20:13 +0200
    Re: $referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-28 13:33 -0400
  Re: $referrer = $_SERVER['HTTP_REFERER'] echo Jerry Stuckle <jstucklex@attglobal.net> - 2013-06-27 17:52 -0400
    Re: $referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-28 14:07 -0400
      Re: $referrer = $_SERVER['HTTP_REFERER'] echo Jerry Stuckle <jstucklex@attglobal.net> - 2013-06-28 15:26 -0400
        Re: $referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-28 16:03 -0400
          Re: $referrer = $_SERVER['HTTP_REFERER'] echo Jerry Stuckle <jstucklex@attglobal.net> - 2013-06-28 16:07 -0400
            Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-28 22:46 +0200
              Re: $referrer = $_SERVER['HTTP_REFERER'] echo Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 23:58 +0200

csiph-web