FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Beginner's trouble with substr
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Beginner's trouble with substr [message #179462 is a reply to message #179458] Tue, 30 October 2012 05:19 Go to previous message
C is currently offline  C
Messages: 24
Registered: January 2012
Karma:
Junior Member
On 29 loka, 22:44, Doug Miller <doug_at_milmac_dot_...@example.com>
wrote:
> wrong.addres...@gmail.com wrote in news:c67eb83e-13d8-4263-b723-a10744fcd444
> @googlegroups.com:
>
>
>
>> What am I doing wrong in this? The substr part does not seem to get processed properly.
>
> That is because you are not using it properly.http://us3.php.net/manual/en/function.substr.php
>
> The second parameter is the starting position, not (as you appear to believe) the length;
> length is the *third* parameter.
>

Yes, that is what I did wrong. Thanks.

>
>
>> <?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';}
>
>> ?>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Requesting Help with a Regular Expression
Next Topic: skipping question "Do you want to save or open the file"
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 21:38:17 GMT 2024

Total time taken to generate the page: 0.04550 seconds