Re: [PHP] PHP programming strategy

2009-08-01 Thread Paul M Foster
On Sun, Aug 02, 2009 at 11:25:40AM +1000, Clancy wrote: > Is anyone here interested in discussing programming strategy, or or know > of a discussion > group which is interested in the subject? > > The sorts of questions I am interested in are: > > 1. I have a highly variable program which always

[PHP] Re: Problem: Writing into Files?

2009-08-01 Thread Parham Doustdar
Dear Ollisso, I tried it with FLock() but it still didn't work. This is what I did: [code] $fp = fopen($f, "r"); $count =fgets($fp, 1024); fclose($fp); $fw = fopen($f, "w"); while (!flock($fw, LOCK_EX)) sleep(1); $cnew = $count + 1; $countnew = fputs($fw, $count + 1); flock($fw, LOCK_UN); fclose($f

Re: [PHP] PHP programming strategy

2009-08-01 Thread Eddie Drapkin
> I actually benchmarked that once.  I had a reasonably large PHP file that was, > in fact, over 50% docblocks.  That's not even counting inline comments.  While > trying to find things to optimize, removing about 800 lines worth of comments > (all of the docblocks) did, in fact, produce a noticeab

Re: [PHP] PHP programming strategy

2009-08-01 Thread Larry Garfield
On Saturday 01 August 2009 8:25:40 pm Clancy wrote: > Is anyone here interested in discussing programming strategy, or or know of > a discussion group which is interested in the subject? > > The sorts of questions I am interested in are: > > 1. I have a highly variable program which always shows th

[PHP] PHP programming strategy

2009-08-01 Thread Clancy
Is anyone here interested in discussing programming strategy, or or know of a discussion group which is interested in the subject? The sorts of questions I am interested in are: 1. I have a highly variable program which always shows the same page, but which includes different modules to give di

RE: [PHP] clean url problem .htaccess

2009-08-01 Thread HallMarc Websites
a (shared) hosting > provider. > > Meh, there is that! Find a host that has requirements you are looking for. Which reminds me... I do allow this in my hosting packages. Marc Hall HallMarc Websites 610.446.3346 __ Information from ESET Smart Security, version of virus sign

RE: [PHP] clean url problem .htaccess

2009-08-01 Thread HallMarc Websites
to use /article without php extention. is there a way > around? > > > > Look up mod_rewrite. > > Andrew Have you checked to see if you hosting environment allows custom php.ini files? If so, then ask them for information that governs their setup on your server. Thank

[PHP] Re: 2 ifs embedded? (RESOLVED)

2009-08-01 Thread Colin Guthrie
'Twas brillig, and Miller, Terion at 31/07/09 17:11 did gyre and gimble: If (ctype_digit($row['critical'])){echo(" Critical violations found: ". $row['critical'] .". "); Remember that empty() does clever stuff for you. empty('') == true empty(0) == true empty('0') == true empty(1) ==

Re: [PHP] Re: Clean break.

2009-08-01 Thread ollisso
On Sat, 01 Aug 2009 01:37:56 +0300, Paul Halliday wrote: Actually, I don't think that regexp's are very slow :) But I haven't tested them from that perspective. You should just benchamrk different approaches :) btw, not sure that substr will help you a lot: first you have to get a begining

[PHP] RE: Newbie: can't access a return value.

2009-08-01 Thread MEM
Solved. Forget to assigning the return value of the method to anything. :S Sorry. Márcio > -Original Message- > From: MEM [mailto:tal...@gmail.com] > Sent: sábado, 1 de Agosto de 2009 17:13 > To: 'php-general@lists.php.net' > Subject: Newbie: can't access a return value. > > Hi all, > >

Re: [PHP] Newbie: can't access a return value.

2009-08-01 Thread TG
Try: $records = $associacao_dao->listar($limit, $offset); -TG - Original Message - From: "MEM" To: Date: Sat, 1 Aug 2009 17:13:09 +0100 Subject: [PHP] Newbie: can't access a return value. > Hi all, > > When I do this: > $associacao_dao->listar($limit, $offset); > > I can var_dump th

Re: [PHP] clean url problem .htaccess

2009-08-01 Thread O. Lavell
A.a.k wrote: > what if I don't have access to server to enable mod_rewrite like a > hosting, is there anyway to work around? No. > just don't want to build entire website and finally can't get a hosting > to enable mod_rewrite for me. Then make it a requirement when you are choosing a (shared)

[PHP] Newbie: can't access a return value.

2009-08-01 Thread MEM
Hi all, When I do this: $associacao_dao->listar($limit, $offset); I can var_dump the correct $limit. I can var_dump the correct $offset. I CAN'T access the object that I was hoping to get, called $records. After this, I was hoping to do var_dump($records); and see the stdClass object. Here

Re: [PHP] clean url problem .htaccess

2009-08-01 Thread kranthi
mod_rewrite is the best solution available to your case. more over if you are sure that your host supports .htaccess, there is very little chance that they will block mod rewrite alone. you can confirm that by phpinfo. look in apache2handler-> Loaded Modules section (this does not tell you if .hta

Re: [PHP] clean url problem .htaccess

2009-08-01 Thread A.a.k
what if I don't have access to server to enable mod_rewrite like a hosting, is there anyway to work around? just don't want to build entire website and finally can't get a hosting to enable mod_rewrite for me. "Andrew Ballard" wrote in message news:b6023aa40907312352j405778fevd0c38315c3983..

[PHP] Re: Problem: Writing into Files?

2009-08-01 Thread Ollisso
On Sat, 01 Aug 2009 08:20:23 +0300, "Parham Doustdar" wrote: Hi there, I've written a counter for my blog, which keeps the count of visitors in a file. However, when the visitors get too many, it resets to zero. Why? Here's the piece of code: [code] $f = $dir . '/view_counter' .EXT; $fp