From owner-freebsd-questions@FreeBSD.ORG Thu Mar 24 18:18:52 2011 Return-Path: Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE1BE1065670 for ; Thu, 24 Mar 2011 18:18:51 +0000 (UTC) (envelope-from editor@d3photography.com) Received: from server.cwis.biz (70-89-202-5-invergrove-mn.hfc.comcastbusiness.net [70.89.202.5]) by mx1.freebsd.org (Postfix) with ESMTP id 997728FC14 for ; Thu, 24 Mar 2011 18:18:51 +0000 (UTC) Received: from server.cwis.biz (localhost [127.0.0.1]) by server.cwis.biz (Postfix) with ESMTP id E3D382639B5E; Thu, 24 Mar 2011 13:19:16 -0500 (CDT) X-Virus-Scanned: amavisd-new at cwis.biz Received: from server.cwis.biz ([127.0.0.1]) by server.cwis.biz (server.cwis.biz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3rjfgPotrM-W; Thu, 24 Mar 2011 13:19:04 -0500 (CDT) Received: from [192.168.46.76] (unknown [64.122.64.171]) by server.cwis.biz (Postfix) with ESMTPSA id EB1122639B59; Thu, 24 Mar 2011 13:19:03 -0500 (CDT) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Ryan Coleman In-Reply-To: <20110324175602.GC15209@thought.org> Date: Thu, 24 Mar 2011 13:18:36 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <3842AB1E-D93A-43C6-BFA5-8333BF10E4FD@d3photography.com> References: <20110323164504.GA25317@thought.org> <20110324175602.GC15209@thought.org> To: Gary Kline X-Mailer: Apple Mail (2.1082) Cc: FreeBSD Mailing List Subject: Re: why does this simple counter fail? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2011 18:18:52 -0000 Check your apache error_log, too. On Mar 24, 2011, at 12:56 PM, Gary Kline wrote: > On Wed, Mar 23, 2011 at 11:47:16AM -0500, Ryan Coleman wrote: >> Do you have an error for it? >>=20 >> If not... add after the first > error_reporting(9); >>=20 >> And see what it reports. >=20 >=20 > There were no errors that should up when i launched this script > on www.thought.org; it simply failed; no output. ...Another php > script that output a random string on the same page did have > errors. I thought i would try this simpler script first. will > add the err line and retry, tx, >=20 > gary >=20 >=20 >>=20 >> -- >> Ryan >> PHP dev. >>=20 >>=20 >> On Mar 23, 2011, at 11:45 AM, Gary Kline wrote: >>=20 >>>=20 >>> Guys, >>>=20 >>> Can any of you php hackers tell me why this simple self-hacked >>> counter bomb? >>>=20 >>> appended. >>>=20 >>> tia. >>>=20 >>> --=20 >>> Gary Kline kline@thought.org http://www.thought.org Public = Service Unix >>> Journey Toward the Dawn, E-Book: http://www.thought.org >>> The 7.98a release of Jottings: http://jottings.thought.org >>>=20 >>> >>>=20 >>> >>=20 >>> $directory=3D"./countdir/"; >>>=20 >>> if (! (file_exists( ($directory.$file)) )) >>> { >>> if (! ($fp =3D fopen( ($directory.$file), "w")) ) >>> { >>> echo "Can't create file '$directory.$file'"; >>> exit(1); >>> } >>> else >>> { >>> fseek($fp,0); >>> fputs($fp, $count); >>> fputs($fp, "\n"); >>> fputs($fp, $file); >>> fclose($fp); >>> } >>> } >>>=20 >>> if (file_exists( ($directory.$file))) >>> { >>> $fp =3D fopen($directory.$file, "r+"); >>> flock($fp, 1); >>> $count =3D fgets($fp, 4096); >>> $count +=3D 1; >>> fseek($fp,0); >>> fputs($fp, $count); >>> fputs($fp, "\n"); >>> fputs($fp, $file); >>>=20 >>> flock($fp, 3); >>> fclose($fp); >>> ?> >>>=20 >>>
>>> >>> >>>=20 >>> >> print " there have been "; >>> ?> >>>=20 >>> >>> >>>=20 >>> >> print $count; >>> ?> >>>=20 >>> >>> >>> >> print "hits\n"; >>> ?> >>>=20 >>>
>>>=20 >>> >>=20 >>> }=20 >>> else >>> { >>> print "Can't find file, check '$directory.$file'\n"; >>> } >>>=20 >>> ?> >>>=20 >>> _______________________________________________ >>> freebsd-questions@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >>> To unsubscribe, send any mail to = "freebsd-questions-unsubscribe@freebsd.org" >>=20 >=20 > --=20 > Gary Kline kline@thought.org http://www.thought.org Public Service = Unix > Journey Toward the Dawn, E-Book: http://www.thought.org > The 7.98a release of Jottings: http://jottings.thought.org >=20 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to = "freebsd-questions-unsubscribe@freebsd.org"