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


Groups > comp.lang.php > #7388

Re: Beginner's trouble with substr

From Salvatore <sal@yojimbo.hack.invalid>
Newsgroups comp.lang.php
Subject Re: Beginner's trouble with substr
Date 2012-10-29 17:34 +0000
Organization Yojimbo NNTP server
Message-ID <k6memb$2m6u$1@news.tokachu.com> (permalink)
References <c67eb83e-13d8-4263-b723-a10744fcd444@googlegroups.com>

Show all headers | View raw


On 2012-10-29, wrong.address.1@gmail.com <wrong.address.1@gmail.com> wrote:
>
> What am I doing wrong in this? The substr part does not seem to get processed properly.
>
><?php
>
> global $host;
> $host=@gethostbyaddr($REMOTE_ADDR);
> if ($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"] != "")
>    {$realhost = @gethostbyaddr($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]);}
> $referer = $HTTP_REFERER;
>
> if (substr($host, -3) == ".xy") {exit;} //
> if (substr($host, 6) == "abcd29") {exit;} //
> if (substr($referer, -4) == ".xyz") {exit;} //
>
> if ($found == 1) {include 'simple.html';} else {include 'home.html';}
>
> ?>

The first thing I see wrong is that the variable "$found" is not
declared.

What are you trying to achieve?

-- 
Blah blah bleh...
GCS/CM d(-)@>-- s+:- !a C++$ UBL++++$ L+$ W+++$ w M++ Y++ b++

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


Thread

Beginner's trouble with substr wrong.address.1@gmail.com - 2012-10-29 10:20 -0700
  Re: Beginner's trouble with substr Salvatore <sal@yojimbo.hack.invalid> - 2012-10-29 17:34 +0000
    Re: Beginner's trouble with substr C <wrong.address.1@gmail.com> - 2012-10-29 10:40 -0700
      Re: Beginner's trouble with substr Salvatore <sal@yojimbo.hack.invalid> - 2012-10-29 19:46 +0000
        Re: Beginner's trouble with substr C <wrong.address.1@gmail.com> - 2012-10-29 22:18 -0700
      Re: Beginner's trouble with substr Denis McMahon <denismfmcmahon@gmail.com> - 2012-10-29 22:47 +0000
        Re: Beginner's trouble with substr C <wrong.address.1@gmail.com> - 2012-10-29 22:21 -0700
      Re: Beginner's trouble with substr Denis McMahon <denismfmcmahon@gmail.com> - 2012-10-29 23:17 +0000
        Re: Beginner's trouble with substr C <wrong.address.1@gmail.com> - 2012-10-29 22:30 -0700
  Re: Beginner's trouble with substr Doug Miller <doug_at_milmac_dot_com@example.com> - 2012-10-29 20:44 +0000
    Re: Beginner's trouble with substr C <wrong.address.1@gmail.com> - 2012-10-29 22:19 -0700

csiph-web