[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. # The next several lines declare an array of

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) and

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
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 tag. On 2/14/2011 8:30 P

Re: [PHP] code quest

2011-02-14 Thread Richard Quadling
On 15 February 2011 00:53, 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 im

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

2010-12-12 Thread a...@ashleysheridan.co.uk
And the obvious difference, print returns true on success. I'm not sure what would cause an echo it print to ever fail, so it really doesn't make a huge difference. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: "Alexandru Patranescu" Date: Sun, Dec 12, 2010 18:56

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:2

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 O'Reill

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 cla

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 Tamara Temple
On Dec 4, 2010, at 2:58 PM, Kirk Bailey wrote: the code is now: '; echo include($d.'/desc.txt' ); There should be no echo here echo ''.PHP_EOL; } } ?> And it works! BUT! Where is the "1" coming from?!? Please inspect the page and see what I mean. This is no

Re: [PHP] code quest

2010-12-04 Thread Daniel P. Brown
On Sat, Dec 4, 2010 at 15:58, Kirk Bailey 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 print the status retur

Re: [PHP] code quest

2010-12-04 Thread Richard Quadling
On 4 December 2010 20:58, Kirk Bailey wrote: > the code is now: > >     are NOT to be listed! >   $excludes[] = 'images'; >   $excludes[] = 'cgi-bin'; >   $excludes[] = 'vti_cnf'; >   $excludes[] = 'private'; >   $excludes[] = 'thumbnail'; > >   $ls = scandir(dirname(__FILE__)); >   foreach ($ls

Re: [PHP] code quest

2010-12-04 Thread Kirk Bailey
the code is now: '; echo include($d.'/desc.txt' ); echo ''.PHP_EOL; } } ?> And it works! BUT! Where is the "1" coming from?!? Please inspect the page and see what I mean. This is not in the code, and it's not in the source file. Link: http://www.howlermon

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: '.include('./'.$d.'/desc.txt') ;#.''.PHP_EOL; } } ?> the url again, to view the results, is http://www.howlermonkey

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: '.include('./'.$d.'/desc.txt') ;#.''.PHP_EOL; } } ?> the url again, to view the results, is http://www.howlermonkey.net/dirlisting.php and is live right now. Th

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 exis

Re: [PHP] code quest

2010-12-04 Thread Matt Graham
From: 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? If you're using Apache, and you do ...the PHP in something.php will execute and produce output, but something.php will not have any access to $_GET or $_POST or $_S

Re: [PHP] code quest

2010-12-04 Thread Kirk Bailey
my current code is as follows: * '.$d.''.PHP_EOL; } } ?> * The page containing this is at this url: http://www.howlermonkey.net/dirlisting.php I believe this will be a starting point for the functionality I am looking for- an automatic menu of areas in a website one may g

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 wrote: [snip!] Can this be improved to exclude anything with a '.' or a '-' in it's name? Th

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 implem

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 B

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 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 l

Re: [PHP] code quest

2010-12-02 Thread Daniel P. Brown
On Wed, Dec 1, 2010 at 23:13, Kirk Bailey 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 then use THAT > as the

Re: [PHP] code quest

2010-12-01 Thread Kirk Bailey
OK, the quest thus far: php experimental page body { margin-left: 5%; margin-right: 5%; } A:link, A:visited, A:active { text-decoration:none; } A:hover { text-decoration:underline; } Subdirectory listing experimental menuing page '.$d.''.PHP_EOL; } } ?>   The results may be seen on

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 fil

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 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 dir

Re: [PHP] code quest

2010-11-27 Thread Daniel P. Brown
On Sat, Nov 27, 2010 at 12:36, Daniel P. Brown 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 directories with rel

Re: [PHP] code quest

2010-11-27 Thread Daniel P. Brown
On Fri, Nov 26, 2010 at 19:03, Kirk Bailey wrote: > > I need a routine that will return a list of every directory immediately > under the current directory- but nothing else, just a list of directories, 1 > level deep, NO FILES, no listing of current dir or prior dir either. Simple: '.$d

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 wrote: > > > On Fri, Nov 26, 2010 at 7: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 t

Re: [PHP] code quest

2010-11-26 Thread Bastien
On 2010-11-26, at 7:33 PM, Adam Richardson wrote: > On Fri, Nov 26, 2010 at 7: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 bas

Re: [PHP] code quest

2010-11-26 Thread Adam Richardson
On Fri, Nov 26, 2010 at 7: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