[PHP] Re:[PHP] code quest

2011-02-15 Thread Kirk Bailey
Frankly, while that modulo looks like something worthy of learning, for my immediate time critical need I went with a quicker method, which is working. The complete script is below. It simply counts cells and resets the row when a number is exceeded. ?php # The next several lines declare an

[PHP] code quest

2011-02-14 Thread Kirk Bailey
Now I have a situation. I need to take the code from my former home page and modify it to lay out a table (let's say 5 cells wide) and as many rows deep to contain all the items. Each item is the name of the directory, under which is an icon image from that directory, under which is a

Re: [PHP] code quest

2011-02-14 Thread Richard Quadling
On 15 February 2011 00:53, Kirk Bailey kbai...@howlermonkey.net wrote: Now I have a situation. I need to take the code from my former home page and modify it to lay out a table (let's say 5 cells wide) and as many rows deep to contain all the items. Each item is the name of the directory, under

Re: [PHP] code quest

2011-02-14 Thread Kirk Bailey
well, this ends the row after every cell. I am trying to get a row of 5 cells across, then end it and start a new row. If the routines stops before the end of the count of 5 due to lack of further directories, closing out the table following the loops will onclude a /tr tag. On 2/14/2011

Re: [PHP] code quest

2011-02-14 Thread Jim Lucas
On 2/14/2011 4:53 PM, Kirk Bailey wrote: Now I have a situation. I need to take the code from my former home page and modify it to lay out a table (let's say 5 cells wide) and as many rows deep to contain all the items. Each item is the name of the directory, under which is an icon image

Re: [PHP] code quest

2011-02-14 Thread Kirk Bailey
Very nice; I am leaning in the direction of doing it this way. Thank you! :-) On 2/14/2011 9:24 PM, Jim Lucas wrote: On 2/14/2011 4:53 PM, Kirk Bailey wrote: Now I have a situation. I need to take the code from my former home page and modify it to lay out a table (let's say 5 cells wide)

Re: [PHP] code quest - ECHO?!?

2010-12-12 Thread David Robley
Kirk Bailey wrote: Ok, so what is echo, and how is it different from print. The code in code quest used echo. I have a copy of learning php 5.0 from O'Reilly, and noplace does it mention echo. Why? What's the difference? IS there a difference? Is there an advantage to either? Please clarify

Re: [PHP] code quest - ECHO?!?

2010-12-12 Thread Kirk Bailey
Groovy; they appear to be identical in all but name. IDENTICAL. Or am I missing a subtle definition difference? David Robley wrote: Kirk Bailey wrote: Ok, so what is echo, and how is it different from print. The code in code quest used echo. I have a copy of learning php 5.0 from

Re: [PHP] code quest - ECHO?!?

2010-12-12 Thread Alexandru Patranescu
They are almost identical. Echo supports multiple parameters like echo $a, $b; print is 20% slower than echo (by some tests). echo is shorter than print so it's easy to write. In fact it's all a matter of taste. The same reason we user die instead of exit. Alex On Sun, Dec 12, 2010 at 6:23 PM,

Re: [PHP] code quest - ECHO?!?

2010-12-12 Thread a...@ashleysheridan.co.uk
, Dec 12, 2010 18:56 Subject: [PHP] code quest - ECHO?!? To: Kirk Bailey kbai...@howlermonkey.net Cc: php-general@lists.php.net They are almost identical. Echo supports multiple parameters like echo $a, $b; print is 20% slower than echo (by some tests). echo is shorter than print so it's easy

Re: [PHP] code quest - ECHO?!?

2010-12-10 Thread Kirk Bailey
Ok, so what is echo, and how is it different from print. The code in code quest used echo. I have a copy of learning php 5.0 from O'Reilly, and noplace does it mention echo. Why? What's the difference? IS there a difference? Is there an advantage to either? Please clarify for this newbie.

Re: [PHP] code quest

2010-12-04 Thread Kirk Bailey
OK, now here's a giggle; I like ssi includes. If I put the script in as an ssi include, will it still work? The functionality would also be useful on a page besides the default landing page, such as a 404error.html page, or a thank you page. -- end Very Truly yours, - Kirk

Re: [PHP] code quest

2010-12-04 Thread Kirk Bailey
A good point, but in this application there WILL be AT LEAST 1 legitimate directory at all times, or else the script would not be used, so this ought not be a problem. My problem is that I understand the basic functions to implement, but have not yet aquired sufficient command of php to

Re: [PHP] code quest

2010-12-04 Thread Kirk Bailey
Now Now, fight nice. We don need no stinkin' @$^*$^(! woids here. :-P Steve Staples wrote: On Thu, 2010-12-02 at 10:07 -0500, Daniel P. Brown wrote: On Wed, Dec 1, 2010 at 23:13, Kirk Bailey kbai...@howlermonkey.net wrote: [snip!] Can this be improved to exclude anything with a '.'

Re: [PHP] code quest

2010-12-04 Thread Kirk Bailey
my current code is as follows: *ul ?php # The next several lines declare an array of directories which are NOT to be listed! $excludes[] = 'images'; $excludes[] = 'cgi-bin'; $excludes[] = 'vti_cnf'; $excludes[] = 'private'; $excludes[] = 'thumbnail'; $ls =

Re: [PHP] code quest

2010-12-04 Thread Matt Graham
From: Kirk Bailey kbai...@howlermonkey.net OK, now here's a giggle; I like ssi includes. If I put the script in as an ssi include, will it still work? If you're using Apache, and you do !--#include virtual=something.php -- ...the PHP in something.php will execute and produce output, but

Re: [PHP] code quest

2010-12-04 Thread Kirk Bailey
Ok, let's kick this around. iterating an array(?; 1 dimensional listing of things) in php, I am creating a list of direcoties. I want to open and read in a file in each directory with a standard name, which contains a 1 line description of the directory and it's purpose. Now, here's the

Re: [PHP] code quest

2010-12-04 Thread Kirk Bailey
The hound barks, but does not yet properly hunt, and we need to bring home the bacon. OK, here is the current code: ?php # The next several lines declare an array of directories which are NOT to be listed! $excludes[] = 'images'; $excludes[] = 'cgi-bin'; $excludes[] = 'vti_cnf';

Re: [PHP] code quest

2010-12-04 Thread Tamara Temple
On Dec 4, 2010, at 2:15 PM, Kirk Bailey wrote: The hound barks, but does not yet properly hunt, and we need to bring home the bacon. OK, here is the current code: ?php # The next several lines declare an array of directories which are NOT to be listed! $excludes[] = 'images';

Re: [PHP] code quest

2010-12-04 Thread Kirk Bailey
the code is now: ?php # The next several lines declare an array of directories which are NOT to be listed! $excludes[] = 'images'; $excludes[] = 'cgi-bin'; $excludes[] = 'vti_cnf'; $excludes[] = 'private'; $excludes[] = 'thumbnail'; $ls = scandir(dirname(__FILE__));

Re: [PHP] code quest

2010-12-04 Thread Richard Quadling
On 4 December 2010 20:58, Kirk Bailey kbai...@howlermonkey.net wrote: the code is now:   ?php # The next several lines declare an array of directories which   are NOT to be listed!   $excludes[] = 'images';   $excludes[] = 'cgi-bin';   $excludes[] = 'vti_cnf';   $excludes[] = 'private';  

Re: [PHP] code quest

2010-12-04 Thread Daniel P. Brown
On Sat, Dec 4, 2010 at 15:58, Kirk Bailey kbai...@howlermonkey.net wrote: And it works!   BUT! Where is the 1 coming from?!? No need to see the page. You're echo'ing an include. No need to do that; including the file is enough, and that's what's working. Adding the echo makes it

Re: [PHP] code quest

2010-12-04 Thread Tamara Temple
On Dec 4, 2010, at 2:58 PM, Kirk Bailey wrote: the code is now: ?php # The next several lines declare an array of directories which are NOT to be listed! $excludes[] = 'images'; $excludes[] = 'cgi-bin'; $excludes[] = 'vti_cnf'; $excludes[] = 'private'; $excludes[] = 'thumbnail';

Re: [PHP] code quest

2010-12-02 Thread Daniel P. Brown
On Wed, Dec 1, 2010 at 23:13, Kirk Bailey kbai...@howlermonkey.net wrote: [snip!] Can this be improved to exclude anything with a '.' or a '-' in it's name? This will exclude the smileys and cgi-bin and such. If it can be persuaded to read a 1 line description from each subdirectory it could

Re: [PHP] code quest

2010-12-02 Thread Steve Staples
On Thu, 2010-12-02 at 10:07 -0500, Daniel P. Brown wrote: On Wed, Dec 1, 2010 at 23:13, Kirk Bailey kbai...@howlermonkey.net wrote: [snip!] Can this be improved to exclude anything with a '.' or a '-' in it's name? This will exclude the smileys and cgi-bin and such. If it can be persuaded

Re: [PHP] code quest

2010-12-01 Thread Jim Lucas
On 11/26/2010 4:03 PM, Kirk Bailey wrote: Hello all, my name is Kirk Bailey, and I am new to php, so please be forbearing. I code in python, and am trying to learn this language as our new client runs a web business based in it. I need a routine that will return a list of every directory

Re: [PHP] code quest

2010-12-01 Thread Kirk Bailey
Daniel, this is so close to bang on it's unbelivable. Only prob is my host provided me with this $^@%^^$! dir which is named .smileys, which holds icons for use in the control panel. It should NOT list it, nor list the /cgi-bin, nor /images. Can it somehow exclude those 3, or maybe a list of

Re: [PHP] code quest

2010-12-01 Thread Kirk Bailey
OK, answered my own question; no, an ssi statement inside a php echo statement is simply sent out as is, unparxsed. But if it is external to the php area, it works fine, so we have to include a function in there that will read anything I want to spew- like the 1 line contents of a desciptor

Re: [PHP] code quest

2010-12-01 Thread Kirk Bailey
OK, the quest thus far: html head TITLEphp experimental page/TITLE style TYPE=text/css body { margin-left: 5%; margin-right: 5%; } A:link, A:visited, A:active { text-decoration:none; } A:hover { text-decoration:underline; } /style /head BODY text=00 bgcolor=FF h2 align=centerSubdirectory

Re: [PHP] code quest

2010-11-27 Thread Ashley Sheridan
On Fri, 2010-11-26 at 20:27 -0500, Bastien wrote: On 2010-11-26, at 7:33 PM, Adam Richardson simples...@gmail.com wrote: On Fri, Nov 26, 2010 at 7:03 PM, Kirk Bailey kbai...@howlermonkey.netwrote: Hello all, my name is Kirk Bailey, and I am new to php, so please be

Re: [PHP] code quest

2010-11-27 Thread Daniel P. Brown
On Sat, Nov 27, 2010 at 12:36, Daniel P. Brown daniel.br...@parasane.net wrote:   If you want something more powerful - and often quicker - check into SPL: specifically FilesystemIterator[1], DirectoryIterator[2], and RecursiveDirectoryIterator[3].  A quick example to link all child files and

[PHP] code quest

2010-11-26 Thread Kirk Bailey
Hello all, my name is Kirk Bailey, and I am new to php, so please be forbearing. I code in python, and am trying to learn this language as our new client runs a web business based in it. I need a routine that will return a list of every directory immediately under the current directory- but

Re: [PHP] code quest

2010-11-26 Thread Adam Richardson
On Fri, Nov 26, 2010 at 7:03 PM, Kirk Bailey kbai...@howlermonkey.netwrote: Hello all, my name is Kirk Bailey, and I am new to php, so please be forbearing. I code in python, and am trying to learn this language as our new client runs a web business based in it. I need a routine that will

Re: [PHP] code quest

2010-11-26 Thread Bastien
On 2010-11-26, at 7:33 PM, Adam Richardson simples...@gmail.com wrote: On Fri, Nov 26, 2010 at 7:03 PM, Kirk Bailey kbai...@howlermonkey.netwrote: Hello all, my name is Kirk Bailey, and I am new to php, so please be forbearing. I code in python, and am trying to learn this language as