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


Groups > comp.lang.php > #15153

Re: in a log.txt : how convert IP.IP.IP.IP to IP.IP.*.* (hope of french CNIL) ?

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: in a log.txt : how convert IP.IP.IP.IP to IP.IP.*.* (hope of french CNIL) ?
Date 2015-03-31 09:16 -0400
Organization A noiseless patient Spider
Message-ID <mfe6lf$64t$1@dont-email.me> (permalink)
References <5516e98a$0$2988$426a34cc@news.free.fr> <9RCRw.180861$jx4.20363@fx27.iad> <13863983.OW5F8XF2sQ@PointedEars.de> <551a603a$0$3318$426a74cc@news.free.fr>

Show all headers | View raw


On 3/31/2015 4:52 AM, bird wrote:
> (english now :-)
> 
>>28/03/2015 22:47, Thomas 'PointedEars' Lahn wrote :
>> Lew Pitcher wrote:
>> //.....
>> The log file created by this code will be unreadable and hardly parseable
>> because it will have only one long line: the trailing newline of each
>> entry
>> is missing – fwrite() does not write it by default.
>> //....
> 
> There is a
> ");
> just under
> fwrite($fp, "$time $ip[0].$ip[1] $page $browser");
> 
> it seems to be a correct "newline" regarding results :
> 
> 2015-03-29 03:35 ip.ip.ip.ip / Mozilla/5.0 (iPhone... etc
> 2015-03-29 03:35 ip.ip.ip.ip /index.php?page=Accueil Mozilla/5.0 ... etc
> 
> but now I have
> Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
> expecting T_STRING or T_VARIABLE or T_NUM_STRING in
> /..../lionwiki/index.php on line 50
> 
> line 50:$self = basename($_SERVER['SCRIPT_NAME']);
> 
> .htaccess as "php 1"
> 

Are you saying the code is actually

 fwrite($fp, "$time $ip[0].$ip[1] $page $browser
 ");

?  If so, you need to post it EXACTLY AS WRITTEN.  White space in
strings is important!

If not, then you must have another fwrite which adds a newline character
further down your code.

As for this problem - it is almost assuredly mismatched single quotes
higher up in our code.

This is where a syntactically intelligent editor comes in handy - you
can easily find things like this.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

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


Thread

dans un log.txt : reduire IP à deux octets selon recomm CNIL bird <new.bird@free.fr> - 2015-03-28 18:48 +0100
  Re: dans un log.txt : reduire IP à deux octets selon recomm CNIL Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-03-28 14:58 -0400
    Re: dans un log.txt : reduire IP à deux octets selon recomm CNIL Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-28 22:47 +0100
      in a  log.txt : how convert IP.IP.IP.IP to IP.IP.*.* (hope of french CNIL) ? bird <new.bird@free.fr> - 2015-03-31 10:52 +0200
        Re: in a  log.txt : how convert IP.IP.IP.IP to IP.IP.*.* (hope of french CNIL) ? Jerry Stuckle <jstucklex@attglobal.net> - 2015-03-31 09:16 -0400
        Re: in a  log.txt : how convert IP.IP.IP.IP to IP.IP.*.* (hope of french CNIL) ? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-31 22:28 +0200
  Re: dans un log.txt : reduire IP à deux octets selon recomm CNIL Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2015-03-28 20:15 +0100
    Re: dans un log.txt : reduire IP à deux octets selon recomm CNIL Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-28 22:50 +0100

csiph-web