[PHP] code quest
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 nothing else, just a list of directories, 1 level deep, NO FILES, no listing of current dir or prior dir either. Now in python, I would use os.walk, and use the list of dirs and throw the other 2 lists away, but this ain't Kansas anymore. Does php even DO lists? Um, a list is a 1 dimenional array, if have a list ALIST and you plug in 3, you get back the contents of cell 3 in the list, whaqtever that content is. so if cell 3 in a 6 celled list was "Ruby" then ALIST[3] would return the string "ruby". It's easy to iterate lists. For instance: print '' for dir in ALIST: print '",dir,' print ' This would let me produce an ordered list of directories, each a link to that directory. This way, when a client installs a new product, the home page area listing products offered automatically updates. Further embellishment would let me replace the dir name with a BRIEF description from a descriptor file read from that dir. Now how to do this in php? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] code quest
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 things not to notice? Also, how compatible is it with SSI includes? If part of the echo is an ssi include statement, will it work right? Hmmm... Daniel P. Brown wrote: 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.''.PHP_EOL; } } ?> 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 relative linking: $v) { if (!preg_match('/\./',$v)) { $v = str_replace($path.'/',null,$v); // We only want relative linking echo ''.$v.''.PHP_EOL; } } ?> -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think
Re: [PHP] code quest
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 file in a particular directory. The idea is to create a directory lister which reads a descriptor for that folder and uses it as the text for the link. Daniel P. Brown wrote: 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 relative linking: Might help to provide the key as well, eh? Sorry ^1: http://php.net/filesystemiterator ^2: http://php.net/directoryiterator ^3: http://php.net/recursivedirectoryiterator -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think
Re: [PHP] code quest
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 this page: http://www.howlermonkey.net/dirlisting.php 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 text in the link, instead of the name. This could be useful in many settings. Daniel P. Brown wrote: 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 lev Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] code quest
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 Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] code quest
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 implement the required multi step algorithm. Jim Lucas wrote: 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 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. Now in python, I would use os.walk, and use the list of dirs and throw the other 2 lists away, but this ain't Kansas anymore. Does php even DO lists? Um, a list is a 1 dimenional array, if have a list ALIST and you plug in 3, you get back the contents of cell 3 in the list, whaqtever that content is. so if cell 3 in a 6 celled list was "Ruby" then ALIST[3] would return the string "ruby". It's easy to iterate lists. For instance: print '' for dir in ALIST: print '",dir,' print ' This would let me produce an ordered list of directories, each a link to that directory. This way, when a client installs a new product, the home page area listing products offered automatically updates. Further embellishment would let me replace the dir name with a BRIEF description from a descriptor file read from that dir. Now how to do this in php? This should do. The only problem that I foresee would be an empty "" if you have no directories returned by glob(). print(''); foreach ( glob('./*', GLOB_ONLYDIR) AS $dir ) print(''.$dir.''); print(''); Jim Lucas -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think
Re: [PHP] code quest
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? 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 text in the link, instead of the name. This could be useful in many settings. Sure. Change: if (is_dir($d) && $d != '.' && $d != '..') { To: if (is_dir($d) && !preg_match('/[\.\-]/',$d)) { Keep in mind, though, that the change will no longer show anything that matches the below either: example.directory example-directory special-images css.files In other words, you may instead want to explicitly state which directories to omit, and then drop anything that begins with a dot as well (hidden directories on *NIX-like boxes) like so: '.$d.''.PHP_EOL; } } ?> -- Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ damn you Daniel... I was just about to reply with almost the EXACT same answer!!! I think the last example would probably be the best one to use, that way you can still have some directories with the . or - or even the _ in the names, and still be able to display them. Steve ps thanks for saving me type it all out Daniel :) -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think
Re: [PHP] code quest
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 go to. By excluding some folders, people don't go trespassing into the cgi-bin or images folder, or into areas reserved for administrative uses. 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 line description from each subdirectory it could then use THAT as the text in the link, instead of the name. This could be useful in many settings. Sure. Change: if (is_dir($d) && $d != '.' && $d != '..') { To: if (is_dir($d) && !preg_match('/[\.\-]/',$d)) { Keep in mind, though, that the change will no longer show anything that matches the below either: example.directory example-directory special-images css.files In other words, you may instead want to explicitly state which directories to omit, and then drop anything that begins with a dot as well (hidden directories on *NIX-like boxes) like so: '.$d.''.PHP_EOL; } } ?> -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think
Re: [PHP] code quest
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 existing code; this code is online NOW at this url: http://www.howlermonkey.net/dirlisting.php * 1 which are 2NOT to be listed! 3$excludes[] = 'images'; 4$excludes[] = 'cgi-bin'; 5$excludes[] = 'vti_cnf'; 6$excludes[] = 'private'; 7$excludes[] = 'thumbnail'; 8 9$ls = scandir(dirname(__FILE__)); 10foreach ($ls as $d) { 11if (is_dir($d) && !preg_match('/^\./',basename($d)) && 12!in_array(basename($d),$excludes)) { 13 echo ''.$d.''.PHP_EOL; 14 } 15} 16?>* Let's say the file to read in /elite is named 'desc.txt'. It looks like you want me to modify line 13 to say: echo ''.include($d.'desc.txt').''.PHP_EOL; so, if the file '/elite/desc.txt' contains the line *82nd Airbourne - We are an elite unit of army Paratroopers * Then that element in the list would appear as: * 82nd Airbourne -We are an elite unit of army Paratroopers And would be clickable. Let's try it and see if this hound hunts. Matt Graham wrote: 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 $_SESSION or any of those things. This is generally not what you want. If you do ...then something.php will be able to see and work with the superglobals that have been set up further up the page, which is *usually* what you want. You could try both approaches in a test env and see what you get. I'll use SSI for "dumb" blocks of text and php include for "smart" blocks of code, because IME that tends to produce fewer instances of gross stupidity. Note that YMMV on all this and ICBW. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think
Re: [PHP] code quest
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. The results are a tad odd to say the least. Kirk Bailey wrote: 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 existing code; this code is online NOW at this url: http://www.howlermonkey.net/dirlisting.php * 1'.$d.''.PHP_EOL; 14 } 15} 16?>* Let's say the file to read in /elite is named 'desc.txt'. It looks like you want me to modify line 13 to say: echo ''.include($d.'desc.txt').''.PHP_EOL; so, if the file '/elite/desc.txt' contains the line *82nd Airbourne - We are an elite unit of army Paratroopers * Then that element in the list would appear as: * 82nd Airbourne -We are an elite unit of army Paratroopers And would be clickable. Let's try it and see if this hound hunts. Matt Graham wrote: 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 $_SESSION or any of those things. This is generally not what you want. If you do ...then something.php will be able to see and work with the superglobals that have been set up further up the page, which is *usually* what you want. You could try both approaches in a test env and see what you get. I'll use SSI for "dumb" blocks of text and php include for "smart" blocks of code, because IME that tends to produce fewer instances of gross stupidity. Note that YMMV on all this and ICBW. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think
Re: [PHP] code quest
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.howlermonkey.net/dirlisting.php I hope this dialog is proving at least mildly interesting to the remainder of the list as an educational exercise. Tamara Temple wrote: 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.net/dirlisting.php and is live right now. The results are a tad odd to say the least. Ok, I don't think that's actually the code that generated the page you link to, but let's go with what you've got. First of all, include() does not return a string to the calling program. include() basically redirects the php interpretter to process the contents of the file. What include() returns is success or failure of the execution of the included script. To use the current setup you have with the desc.txt files, you want to do something like this: echo ''; include('./'.$d.'/desc.txt'); echo ''.PHP_EOL; If the file desc.txt contains only text, it will get sent to the browser as is. Kirk Bailey wrote: 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 existing code; this code is online NOW at this url: http://www.howlermonkey.net/dirlisting.php * 1'.$d.''.PHP_EOL; 14 } 15} 16?>* Let's say the file to read in /elite is named 'desc.txt'. It looks like you want me to modify line 13 to say: echo 'href="'.$d.'">'.include($d.'desc.txt').''.PHP_EOL; so, if the file '/elite/desc.txt' contains the line *82nd Airbourne - We are an elite unit of army Paratroopers * Then that element in the list would appear as: * 82nd Airbourne -We are an elite unit of army Paratroopers And would be clickable. Let's try it and see if this hound hunts. Matt Graham wrote: 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 $_SESSION or any of those things. This is generally not what you want. If you do ...then something.php will be able to see and work with the superglobals that have been set up further up the page, which is *usually* what you want. You could try both approaches in a test env and see what you get. I'll use SSI for "dumb" blocks of text and php include for "smart" blocks of code, because IME that tends to produce fewer instances of gross stupidity. Note that YMMV on all this and ICBW. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+think -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think
Re: [PHP] code quest - ECHO?!?
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. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] code quest - ECHO?!?
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'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. The documentation says it all better than I can: http://php.net/manual/en/function.echo.php http://php.net/manual/en/function.print.php Cheers -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think
Re: [PHP] php in windows
I ran the executable installer. I have no recollection of having opportunity to configure it. On 4/10/2012 12:08 AM, Tommy Pham wrote: On Mon, Apr 9, 2012 at 7:05 PM, Kirk Bailey wrote: The edition of php for windows I instaklled does not work. Which flavor of windows php DOES work properly in windows? -- Did you configure it properly??? I've run it fine from XP (x86& x64), Win2003 (x86& x64) Win2008 (x86& x64), Win7 (x64), and Win2008R2. Easiest is get IIS7 or IIS7.5 (Vista, Win08, Win7, Win2008R2 - including in a VM) and current version IIS PHP Manager. HTH, Tommy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php in windows
It means it does nothing. I have a small server in the computer that works fine. I also installed python in this box- and it worked perfectly without having to do anything to the server. Php on the other hand merely occupies disk space. Aside:Holy cow, you know nothing about windows?!? Considering that Boll Bates and co. are almost as omnipresent as Satan, and have been accused of BEING Satan, that's quite an accomplishment. On 4/10/2012 6:31 AM, Tim Streater wrote: On 10 Apr 2012 at 03:05, Kirk Bailey wrote: The edition of php for windows I instaklled does not work. Which flavor of windows php DOES work properly in windows? What does "does not work" mean? You need to say which OS, which PHP version, what happens, and what you expect to happen. Not that I can help, as I know nothing about Windows, but with that info perhaps another can. -- Cheers -- Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php in windows
I have a web server, and it works fine with python. On 4/10/2012 7:03 AM, Matijn Woudt wrote: On Tue, Apr 10, 2012 at 4:05 AM, Kirk Bailey wrote: The edition of php for windows I instaklled does not work. Which flavor of windows php DOES work properly in windows? It does work, you just didn't take the time to read the manual on how to set it up. If you want to run webpages with it, you also need a web server. If you just want to try PHP on your local machine, you can also use some pre packaged setups that combine the webserver, PHP and more. (XAMPP, WAMP, etc). - Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php in windows
I am not running apache; I am running tinyweb, which is a cgi capable server. It does not need any special configuration to handle cgi, and worked out of the box with python. On 4/10/2012 11:13 AM, Bogdan Ribic wrote: On 4/10/2012 04:05, Kirk Bailey wrote: The edition of php for windows I instaklled does not work. Which flavor of windows php DOES work properly in windows? Trust me, it does work :) I'm running PHP 5.3.10 thread-safe, as apache module on apache 2.4.1 from apache lounge (not official apache builds, as instructed on PHP's download site), all of that on Win XP. Read the instruction in php bundle on setting it up with apache 2.2 branch. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php books
A good tip, thank you. The php cookbook just arrived today, and this weekend I will be doing some cooking. On 4/10/2012 4:22 PM, Govinda wrote: Revisiting said dead horse, it's interesting there is no clear consensus of opinion about what is the best book to use to learn php. Generally, you get several people chiming in talking about the website. Now the website is the bomb indeed, BUT IT'S NOT A BOUND BOOK! So that's a terrific answer to a totally different question. Kirk I did not actually read "Head First PHP& MySQL" (because I was already too deep into PHP before this book even came out), but in general I have really enjoyed learning the beginnings of my experience with various languages from the "Head First" series. That series is generally really user friendly and makes it easy to dive in to the language covered by whichever book you choose. E.g.: http://www.headfirstlabs.com/books/hfphp/ HTH -Govinda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php in windows
ok, I just installed 5.2.17 VC6X86. I have a simple test page, index.php; it spews the content code at me. On 4/10/2012 11:13 AM, Bogdan Ribic wrote: On 4/10/2012 04:05, Kirk Bailey wrote: The edition of php for windows I instaklled does not work. Which flavor of windows php DOES work properly in windows? Trust me, it does work :) I'm running PHP 5.3.10 thread-safe, as apache module on apache 2.4.1 from apache lounge (not official apache builds, as instructed on PHP's download site), all of that on Win XP. Read the instruction in php bundle on setting it up with apache 2.2 branch. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php in windows
ok, there is a copy of index.php ion the cgibin, and this got WAY different results. It puked an error. "CGI script /cgi-bin/index.php returned nothing" NOW W.T.F., over? I think that it's time for some rack time. 'Night all. On 4/11/2012 12:50 AM, Kirk Bailey wrote: ok, I just installed 5.2.17 VC6X86. I have a simple test page, index.php; it spews the content code at me. On 4/10/2012 11:13 AM, Bogdan Ribic wrote: On 4/10/2012 04:05, Kirk Bailey wrote: The edition of php for windows I instaklled does not work. Which flavor of windows php DOES work properly in windows? Trust me, it does work :) I'm running PHP 5.3.10 thread-safe, as apache module on apache 2.4.1 from apache lounge (not official apache builds, as instructed on PHP's download site), all of that on Win XP. Read the instruction in php bundle on setting it up with apache 2.2 branch.
Re: [PHP] Re: php in windows
Steve, THERE IS NO SUCH FILE in tinyweb. It turns to the operating system asspciations to determine what to use to process the cgi, then captures the returned stdio output and feeds THAT back as part of the data stream back down the stack. Therefore, it is not interfacing with the windows operating system properly, and as I do not speak delphi, I am not sure how to go through the sourcecode and rectify this. If you like, I cna provide a link to the installer that adds it to a windows computer so you can take a look- if you or anyone else is interested. Oddly enough, it appears to handle python fine, and is reported by others to also handle perl. Kirk, You have to tell your "tinyweb" what to do with the .php extensions... in the config of the webserver, you will have to add a line saying where the php binary is, or uncomment it (as it probably already exists) and restart the webserver. As it appears to me, since you can have some "code" on the screen, your server does not know how to deal with it, so it will treat it like a text file, and just spew the code out. Once you have it pointing to the php binary, it will work. Good luck! Steve Staples. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] slicing and dicing strings
ok, it slices and dices, but how? in python, to print all but the last char in string FOO, we say print FOO[:-1] But this seems to bark like a basset hound in php. Whyfore? Now tihs tyro is seeking sage words to help me understand this. RTFM is not sage words; if you don't want to help me please don't waste the bandwidth. Would anyone care to help me understand this without dedicating 4 precious and in over demand/under supply hours to RTFM? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] email list 101
So, in php, I want a program to handle sending out a mail list. All this is going to do is be a filter to exclude non subscribers, and send a copy to every person in the subscriber file. This is pretty simple in python, but this is not my mother tounge we speak here, so let's talk in php instead. If the submission does not come from a member, the script simply aborts. So the script should read the subscriber file, and if the source From: does not appear there, DIE. If it is there, walk the array and send a copy there, then end. Now how to do this in php? Is there an off the shelf solution? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] bread and buytter php
Where is a good place for bread and butter day in day out routinely needed functionality in php? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] code quest
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 description file read from that directory. Here is my code thus far: # The next several lines declare an array of directories which are NOT to be listed!# $excludes[] = 'attachments'; #20 $excludes[] = 'data'; $excludes[] = 'include'; $excludes[] = 'resources'; $excludes[] = 'stats'; $excludes[] = '_private'; $excludes[] = '_vti_bin'; $excludes[] = '_vti_cnf'; $excludes[] = '_vti_log'; $excludes[] = '_vti_pvt'; $excludes[] = '_vti_txt'; #30 $excludes[] = '_vxi_txt'; $excludes[] = 'css'; $excludes[] = 'img'; $excludes[] = 'images'; $excludes[] = 'js'; $excludes[] = 'cgi'; $excludes[] = 'cgi-bin'; $excludes[] = 'ssfm'; $ls = scandir(dirname(__FILE__)); echo 'bgcolor="E0E0E0">'; #40 foreach ($ls as $d) { if (is_dir($d) && !preg_match('/^\./',basename($d)) &&!in_array(basename($d),$excludes)) { echo ''.$d.'src="/Categories/'.$d.'/thumb.png" border="5">'; include($d."/desc.txt"); echo ''; }; }; echo ''; ?> Now I am stymied on changing this to add at the right points in the structure. I am new to php, and welcome all suggestions and gainful comments. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] code quest
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 PM, Richard Quadling wrote: 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 image from that directory, under which is a description file read from that directory. Here is my code thus far: '; #40 foreach ($ls as $d) { if (is_dir($d)&& !preg_match('/^\./',basename($d)) &&!in_array(basename($d),$excludes)) { echo ''.$d.''; include($d."/desc.txt"); echo ''; }; }; echo ''; ?> Now I am stymied on changing this to add at the right points in the structure. I am new to php, and welcome all suggestions and gainful comments. $ls = scandir(dirname(__FILE__)); echo ''; #40 foreach ($ls as $d) { if (is_dir($d)&& !preg_match('/^\./',basename($d))&&!in_array(basename($d),$excludes)) { echo '', $d,''; include($d."/desc.txt"); echo ''; }; }; echo ''; maybe? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] code quest
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 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 description file read from that directory. Here is my code thus far: '; #40 foreach ($ls as $d) { if (is_dir($d)&& !preg_match('/^\./',basename($d)) &&!in_array(basename($d),$excludes)) { echo ''.$d.''; include($d."/desc.txt"); echo ''; }; }; echo ''; ?> Now I am stymied on changing this to add at the right points in the structure. I am new to php, and welcome all suggestions and gainful comments. You want modulo math... Check out this page http://www.cmsws.com/examples/php/modulo_array_output.php If you like the output, here is the source http://www.cmsws.com/examples/php/modulo_array_output.phps The bottom two examples show how you can use other HTML tags to present data. Jim Lucas -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re:[PHP] code quest
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 directories which are NOT to be listed!# $excludes[] = 'attachments'; #20 $excludes[] = 'data'; $excludes[] = 'include'; $excludes[] = 'resources'; $excludes[] = 'stats'; $excludes[] = '_private'; $excludes[] = '_vti_bin'; $excludes[] = '_vti_cnf'; $excludes[] = '_vti_log'; $excludes[] = '_vti_pvt'; $excludes[] = '_vti_txt'; #30 $excludes[] = '_vxi_txt'; $excludes[] = 'css'; $excludes[] = 'img'; $excludes[] = 'images'; $excludes[] = 'js'; $excludes[] = 'cgi'; $excludes[] = 'cgi-bin'; $excludes[] = 'ssfm'; $ls = scandir(dirname(__FILE__)); $counter=0; #40 echo 'bgcolor="F0F0F0">'; foreach ($ls as $d) { if (is_dir($d) && !preg_match('/^\./',basename($d)) &&!in_array(basename($d),$excludes)) { ++$counter ; echo ''.$d.'href="'.$d.'">'; echo 'border="5">'; include($d."/desc.txt"); echo ''; if ($counter > 3) { echo ''; #50 $counter=0; } }; }; echo ''; ?> -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
Oh hey, that's a good point. All the stuff i saw so far indented 2 spaces. WHY? Can I just indent a TAB if my editor permits this? indenting 4 spaces (2 nests) is easy, but suppose I hit one extra space- not enough difference to be really noticeable. Let's talk about indentation in php for a moment, could we? On 2/16/2011 6:36 PM, Tamara Temple wrote: On Feb 15, 2011, at 11:23 PM, Brian Waters wrote: On Tue, Feb 15, 2011 at 11:46 PM, Tamara Temple wrote: I was unlucky enough to find someone who coded a function that went on for 30 pages one (this was in C, not PHP) and *that* was hard to untangle. Why!?!?!?!?!?!?! - BW (un?)fortunately, he was no longer with the company, which was why I got to take it over. It wasn't the oddest thing, by far. His designs were hugely complex (way overengineered for the task at hand, plus they didn't work), and he didn't use any consistent indenting style. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 9970318527584
Just for a giggle, please share the context generating the magic number you cite. On 2/18/2011 10:08 PM, John Taylor-Johnston wrote: 9970318527584 Could this number refer to a date()? In late 2009? How could I calculate it? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] web site link request
May I have suggestions of websites I would do well to visit to improve my php skills? Links please, with a breif description if you would be so good. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: $_POST variable
On 3/11/2011 2:43 PM, Geoff Lane wrote: [snip] You could use foreach to iterate through the post variables until you encounter a match: foreach ($_POST as $key => $value){ if (substr($key, 0, 6) == "radio_") { $buttonName = $key; $buttonValue = 4value; break 2; } } I haven't tried the above code, but I hope someone will correct my efforts if I'm wrong. ok, now I am very new to php, so if i got this wrong be nice. It APPEARS TO ME that you are setting a variable called buttonName to the extracted value stored in $key for each name in the post submission, and a variable named buttonValue for the item's value. THEM, you do the same thing again to the same destination variables for the next name/value pair, and so-on until they list of name/value pairs is exhausted. IF this understanding is correct, only the LAST name/value pair will emerge from the process intact; prior values will be obliterated. Would they not be better to append them to a single dimensioned array, which starts life as a null array? If I am getting this wrong, please administer wet mackerel therapy to my tired head and explain the facts. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] neubie seeking answers
I need to extract the name of the subdirectory a page lives in to use in the title for that page. This will be returned as a string to echo to the output stream. Now how the heck do I do that?!? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] neubie seeking answers
PERFECT SIMPLE SOLUTION. THANK YOU! On 3/31/2011 12:34 PM, Stuart Dallas wrote: On Thursday, 31 March 2011 at 17:24, Kirk Bailey wrote: I need to extract the name of the subdirectory a page lives in to use in the title for that page. This will be returned as a string to echo to the output stream. Now how the heck do I do that?!? $dir = basename(dirname(__FILE__)); -Stuart -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] randomly random
OK gang, to spew a single line from a file of fortune cookies, I want to read it and echo one line. While I found a 4 line code which gets it done, I thought there was a preexisting command to do exactly that. Any feedback on this? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] the best 1 book for php
If I only had 1 book on php, what would it be? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] pick a card, any card...
in otherwords, the entire idea of picking one of N objects, whatever they are- strings, numbers, gummybears, lined up in a listing, and return the one item selected. This seems a common enough function there should be a simple way to do it already in php. HOWEVER, I ain't findin' it that way, no sir/maam/other. Maybe I am missing the obvious SIMPLE way to get the job done. So if we have a listing of foo's, we can title this $listing, and we want 1 of them to be returned, we should see something like: randmember($listing) and if the listing was "A","B","C","D","F" and it defaulted to return one of them, a valid return would be "C" for example. opho does not seem to have a function in it, or loadable into it, to accomplish this; I have to write some long winded and complex thing to get the job done, and that's a bloody shame. Any discussion? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] vend-bot?
OK, I want to send someone back from paypal to a thank you page; this reloads to the actual file they will purchase. BUT, I want to include a magic cookie that will prevent someone else from going to that url at a later time and getting the payload without paying for it. Any thoughts on how to build a secure vendobot? Let's discuss this in this thread. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] vend-bot?
ok, here's the deal; we sent someone to the paypal site for their purchase; the site will use the palpal shopping cart. When they come back, there needs to be a way to identify the product and the transaction so they an get the product ONCE. Now for a single purchase, we can just send them to (productname)thankyou.php and attach a magic cookie to the url as a query string. this magic cookie can only be used once. THIS WILL NOT WORK IF WE USE THE FULL SHOPPING CART AND THERE IS MORE THAN ONE PRODUCT TO DOWNLOAD, it only works with a buynow button for one only product. This kind of functionality, if worked out in detail, will lend itself to being adapted to MANY sorts of Eproducts, so I think there's an arguement to be made that this is of benefit to a significant segment of the php community. Well, at th4est them of us who like to get paid reliably, and not get ripped off. A ROUGH STAB AT HOW TO DO IT FOR SINGLE ITEMS As for one time only with buynow buttons: Send the customer to paypal with a cookie from the top of a list. When they come back, read the list's first entry. If it's there, make the download link available. the download is in a secured directory, a la Apache's directory securing methods. GIVE THEM THE PASSWORD. The user name is the magic cookie; tell them this. When they go to that page, apache demands the user name and password, which they give, and the page then (thanks to the query string having the item name) makes a download link available. This page also deletes that magic cookie from the list of them,so it can never be used again. Discussion? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] vend-bot?
On 7/3/2011 4:53 PM, Stuart Dallas wrote: Only allowing them to access the URL once is a bad idea. If their download fails, is corrupt, or any number of other things go wrong (think accelerators, browser accelerators, etc) then you end up with a lot of support mail. Better to give them access for a short period of time. Ok, so it just got more complex- if we let them do it twice, ior three times, we have a more complex design specification; if we let them do it unlimited times, we just defeated thepurpose of the exercise. How about this: if it fails, the customer can email us, adn we can reply with a copy as an attachment; a ripoff artist will not be in the log, and a complaint of failure to download gets them nothing. Personally I would generate a unique token linked to their account, or if no user system exists then link it to their order number. Stick that in a URL and forward them to it. That URL shows them the thanks page and links to download the product(s). Each of those links also contains the token. Expire that token after 24 hours, and on the page telling them it's expired give them a way to contact you just in case they haven't successfully downloaded the product yet. There is no need to use cookies. There is no need to use basic authentication (which is a horrible user experience). They come back from PayPal to a script that sets up their unique URL, then you take them to that URL. KISS it - the more complicated you make this the worse the user experience will be and it won't be any more secure than a time-limited unique token as described above. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] vend-bot?
On 7/6/2011 9:31 AM, Stuart Dallas wrote: On Wed, Jul 6, 2011 at 3:01 AM, Kirk Bailey mailto:kbai...@howlermonkey.net>> wrote: On 7/3/2011 4:53 PM, Stuart Dallas wrote: Only allowing them to access the URL once is a bad idea. If their download fails, is corrupt, or any number of other things go wrong (think accelerators, browser accelerators, etc) then you end up with a lot of support mail. Better to give them access for a short period of time. Ok, so it just got more complex- if we let them do it twice, ior three times, we have a more complex design specification; if we let them do it unlimited times, we just defeated thepurpose of the exercise. How about this: if it fails, the customer can email us, adn we can reply with a copy as an attachment; a ripoff artist will not be in the log, and a complaint of failure to download gets them nothing. I don't see how it got more complex. IT IS SIMPLER TO IMPLEMENT IF IT WORKS EVERY TIME A LEGITIMATE CODE IS PRESENTED IN THE URL. If there is a list of valid passwords and it does not change, the password will work every time. A clever hacker makes 1 purchase and uses this over and over to steal other products- not good. We need to remove the password after it is used. IF the first time it is used the password code is deleted from a file, it cannot work a second time. That is a mild increase in complexity. If we want it to work more than once, then we argue- how many is enough? And how do we track uses? If they got product the first time, the second ( and third, and fourth...) permitted uses are there waiting for a cleve hacker to steal product. And if we build a mechanism to verify successful delivery or product prior to deleting the password, it is more complex still. So we need to take time to think about this in detail. If we allow it once, and delete is as part of the vend process, we also can offer a contact link should they have problems with the download. You need to verify that the user has paid for the file(s) they are trying to access, all this does is add an expiry timestamp to that access rather than a counter. I'm not sure what you're purpose is with this exercise, but usually this sort of thing aims to provide customers with the digital assets they've purchased in a way that's easy for them to understand and use, limits expensive support costs, and protects the assets from being downloaded without first being purchased. And for me, the priorities are in that order. What do you think you gain by limiting the link to a single use? If you think you're preventing them from passing it on to other people, then yes you are, but if you do that then they'll simply send the digital file instead so you're actually trading a poor user experience and increased support costs for practically no benefit. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think
Re: [PHP] vend-bot?
because some emails do not permit large attachments. On 7/6/2011 9:47 AM, Steve Staples wrote: What do you think you gain by limiting the link to a single use? If you think you're preventing them from passing it on to other people, then yes you are, but if you do that then they'll simply send the digital file instead so you're actually trading a poor user experience and increased support costs for practically no benefit. Why not just send the file to them via email on success? As Stuart said, if you're worried about them giving the download URL out to other people, then they will just put it on a file sharing site and give out that URL instead. Either way, unless you have some kind of file locking/binding to IP/mac address and/or a call home feature, it is kinda hard to stop piracy, and even then, there are people who can and will crack it if it is something that useful. Good luck with this. Steve. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] vend-bot?
I already subscribe, of recent. On 7/7/2011 11:58 AM, Tamara Temple wrote: On Jul 7, 2011, at 9:07 AM, Stuart Dallas wrote: Now, what do I win? A free subscription to InformationWeek. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Intentionally generate an "Internal Server Error"
Access a non existant file. Woops! On 8/7/2011 2:42 AM, Paul Scott wrote: On Sun, 2011-08-07 at 07:30 +0100, Ashley Sheridan wrote: Quickest way I know of is to mess up an .htaccess file! Another good way to do it on shared hosts is to give a file incorrect permissions and try and access it -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] book quest
The best book for a beginner? No, don't tell me php.net, I hear that one already, and while it is indeed good, I want something in a dead tree edition I can canny around and smoke as needed. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php on my pc, no go, FUBAR, thank you Bill Gates?
I installed it in a Windows XP PC with a cgi capable server in it. No dice, nothing happens. I also installed python in the same computer. Works perfect. NEITHER language modified the http server. So, what do I have to do to get php to play well with others in a XP environment? Cute remarks about "install Linux" shall be ignored as line-noise. -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] delete and recreate
So, I want to create a script to delete an old file and create a new one which is empty. The script receives a password via query string. The obvious methods give me back a very useless 500 error. Any suggestions on how to accomplish what I seek? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image inventoryer
I need a page that will live in a directory and list all image files in there. That is, the page has tags emitted in it's structure, one per file in the directory with a saught file type- .png, .gif, .jpg, you get the idea. this should use relative addressing so once the tool is built I can use it in other directories as is. Now ai am still a novice at p[hp, how can I do this ? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image inventoryer
ok. ' // notice that is a 'singlequote' immedately followed by a "doublequote". ?> Something like this. In python I would write something like: #!/usr/bin/python import string, glob files=glob.glob("./*.*") # files is a list variable (a 1 dimensional addressable array) for file in files: # for each cell in files do this doblock: if str.split(file,'.')[1] in "gif","jpg","png"): #if the file type is in a list of acceptable types, print ''# print out the material to return surrounding # the file name On 4/5/2012 10:34 PM, Tommy Pham wrote: On Thu, Apr 5, 2012 at 7:26 PM, Kirk Bailey wrote: Now ai am still a novice at p[hp, how can I do this ? Have you read any book on PHP? even the official from PHP.net? Learn the tool so you know how to use it, efficiently. Otherwise how do you know if the tool can do what you want... What you're asking for ATM is someone to write the code for you which is not how it works. You need to provide some code, or even pseudo code at least... HTH, Tommy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image inventoryer
jim, I am a novice at this language as I said. On 4/5/2012 10:44 PM, Jim Giner wrote: As Tommy says - you sound like a total new user who doesn't know how to do it and furthermore doesn't know how many things you are going to have to pick up just to accomplish this task. You have to: determine the folder your script is running from collect an array of image file names from that directory determine the size of each of these images so that you are not building some html that will try to display an unmanageable amount of data all at once. You may then have to learn how to create smaller images for your img tags, which is another learning process in itself determine how many images you will display and decide again if you really can allow the user to make this kind of request. This could also create another step in the process to keep track of what images have already been displayed so that when the screen comes back to your script you can pick up where you left off and display a second page. THEN you can generate the html to produce a useful page of images. At least that's how I would approach it. And I'm not an expert but simply a guy who has put in about a year's worth of effort into learning enough php to actually do something like this already, among other things. And were people this nice to you when YOU asked beginner questions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image inventoryer
Image inventory of this directory body { margin-left: 10; margin-right: 10%; } body {background-attachment:fixed;} A:link, A:visited, A:active { text-decoration:none; } A:hover { text-decoration:underline; } .justify{text-align:justify;} .center{text-align:center;} This page inventories the contents of this directory and lists all image files in order- as the computer determines such matters. Here is the full inventory. '."\n$filename\n\n"; } ?> This works nicely. copied code from online manual, chainsaw editing to fit, superglue in the spare parts needed and it lists them all and composes proper img links to display on the inventory page. NOW I have the tool i needed; can someone else put this to good work? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image inventoryer
Thank you! Not QUITE the first; I have used snippets and small routines for a while; however I did not know how to do this in php. Turns out there are at least 2 methods: glob, and an iteration of the directory with readdir() to build up an array, then one by one print the elements in the array. In python this is not hard. Iteration in python is somewhat different- not to mention getting used to do blocks. Being so used to snake charming, learning a new way means getting used to different procedures. On 4/8/2012 2:18 AM, tamouse mailing lists wrote: On Sat, Apr 7, 2012 at 10:35 PM, Kirk Bailey wrote: Image inventory of this directory body { margin-left: 10; margin-right: 10%; } body {background-attachment:fixed;} A:link, A:visited, A:active { text-decoration:none; } A:hover { text-decoration:underline; } .justify{text-align:justify;} .center{text-align:center;} This page inventories the contents of this directory and lists all image files in order- as the computer determines such matters. Here is the full inventory. '."\n$filename\n\n"; } ?> This works nicely. copied code from online manual, chainsaw editing to fit, superglue in the spare parts needed and it lists them all and composes proper img links to display on the inventory page. NOW I have the tool i needed; can someone else put this to good work? Well, congrats on a first somewhat useful program. All I have to say now is: you have a long way to go. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php books
Revisiting said dead horse, it's interesting there is no clear consensus of opinion about what is the best book to use to learn php. Generally, you get several people chiming in talking about the website. Now the website is the bomb indeed, BUT IT'S NOT A BOUND BOOK! So that's a terrific answer to a totally different question. It's interesting really; it suggests there is a wide range of perspectives and mindsets about wha is the best way to come to understand php. Possibly this suggests something about the general mindset of the php community- wide ranging individualism? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] desk top interactive environment
Php would (IMHO) benefit from an interactive desktop application where you can test and experiment with code interactively, instead of "edit, dsave, run, view webpage result, edit... Python has this; why not php? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] desk top interactive environment
I am not ABLE to create it yet. Anyone else able to? On 4/9/2012 9:45 PM, Jay Blanchard wrote: [snip] On Apr 9, 2012, at 8:38 PM, Kirk Bailey wrote: Php would (IMHO) benefit from an interactive desktop application where you can test and experiment with code interactively, instead of "edit, dsave, run, view webpage result, edit... Python has this; why not php? [/snip] Because you haven't built it yet? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php in windows
The edition of php for windows I instaklled does not work. Which flavor of windows php DOES work properly in windows? -- end Very Truly yours, - Kirk Bailey, Largo Florida kniht +-+ | BOX | +-+ think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php