RE: [PHP] splitting string

2004-11-16 Thread Kelly Hallman
this should only be used for data that is NEVER intended to be queried, but may be usefully extracted on SELECTed records. And we know the wisdom of assuming something will NEVER be necessary! :) -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Adding a realtime monitoring console

2004-09-01 Thread Kelly Hallman
I'm developing a web-based framework ("the application") and would like to implement an ncurses-based realtime monitoring facility ("the console"). The application currently writes events to a database history table, but I don't think having a console that constantly requeries that table would be

RE: [PHP] " in data

2004-06-18 Thread Kelly Hallman
ddslashes() is good for database insertions, but for HTML probably are looking for something like http://www.php.net/htmlentities -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] SCP a file from my server to another using PHP

2004-05-04 Thread Kelly Hallman
could be a security issue, if you are on a shared server, as it might allow other users to use that same key to access the remote server as well. Proceed with caution! > TIA for anyone who has done this and knows the answer!!! Haven't done this, but I think it should work. Hope it helps at least. -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Logic problem

2004-04-20 Thread Kelly Hallman
', ',$array1), implode(', ',$array2)); The more complex the query gets, the easier it is to read using this approach. I'm sure some find that debatable. After all, I'm crazy ;) -- Kelly Hallman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] oo question

2004-04-19 Thread Kelly Hallman
Apr 19 at 3:46pm, Chris W. Parker wrote: > Kelly Hallman <mailto:[EMAIL PROTECTED]> > > I think what you're talking about here is encapsulation. > > in that case what is abstraction? I suppose it's pretty similar, but I believe that encapsulation is the pe

Re: [PHP] Pear Layout question

2004-04-19 Thread Kelly Hallman
> ... As long as the directory containing the PEAR files is in your include path, and it mimics the same structure as the PEAR directory you have on the server (where PEAR is installed) you should be good to go. -- Kelly Hallman -- PHP General Mailing List (http://www.php.net/) To uns

RE: [PHP] Re: oo question

2004-04-19 Thread Kelly Hallman
ting too much into the constructor can add overhead if you want to create lightweight instances of the object for another purpose that you're not envisioning at the moment. -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] oo question

2004-04-19 Thread Kelly Hallman
t;firstName(), and may encourage mixing the way you access the object data from your code, which could potentially defeat the purpose of the get/set method. On that note, you may be interested in the __call(), __get() and __set() magic methods in PHP5, as they will give you the best of both worlds. ...Among many other nice OO feature improvements in PHP5... -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Help with shorting this please

2004-04-19 Thread Kelly Hallman
ir($dir_handle)) { // remove files matching the prefix/suffix, that don't start with dot if (preg_match($regexpattern,$fname) && substr($fname,0,1) != '.') { $modtime = date(DATE_FMT,filemtime($rootpath.$fname)); logger(sprintf('Deleted: %s Last Modified

Re: [PHP] Re: smarty

2004-04-14 Thread Kelly Hallman
here with a sharp rock saying, "but this works too!" Then the guy with the knife started using it to cut everything, while the rock required constant honing to remain sharp enough to do half the work. But the guy with the rock thought it was all he needed! I use a knife. -- Kelly Hallman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Web-Chat Software

2004-04-13 Thread Kelly Hallman
Apr 13 at 4:04pm, Terence wrote: > while (10==10) { // cool while loop > /* ... */ flush(); sleep(1); } ?> Not sure I see the efficacy of this approach for the problem at hand, but what gets me is the cool while loop :) 10==10 is always going to evaluate true, and I realize that this is an infi

Re: [PHP] class design

2004-04-13 Thread Kelly Hallman
Apr 13 at 2:24am, Andy B wrote: > instead of making one super huge class.. > turn that class into a bunch of mini classes. > DbConnect, DbError, DbQuery, DbResult and so on... Right; chances are if you had all the functionality in one class, it's going to be pretty identical to writing it without

Re[2]: [PHP] Serializing objects and storing them is sessions [fixed]

2004-04-09 Thread Kelly Hallman
Apr 10 at 1:39pm, Tom Rogers wrote: > Is your __sleep() function returning the array required by serialization? Since you mentioned it, I tried returning an array and it did not segfault, thought it was initially unclear what the array was for. After reading over most of the documentation about s

Re: [PHP] Serializing objects and storing them is sessions [fixed]

2004-04-09 Thread Kelly Hallman
Apr 9 at 2:49pm, Jason Giangrande wrote: > Kelly Hallman wrote: > > Try it without serializing, it works. > > After retesting, it seems you are correct. I guess the same bad > __sleep() code that was causing the object not to unserialize at all was > also preventing au

Re: [PHP] Serializing objects and storing them is sessions [fixed]

2004-04-09 Thread Kelly Hallman
ariable, without needing to convert it in and out every time. -- Kelly Hallman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Serializing objects and storing them is sessions [fixed]

2004-04-09 Thread Kelly Hallman
Apr 9 at 1:44am, Jason Giangrande wrote: > Jason Giangrande wrote: > > I'm having a problem unserializing objects that are passed from page to > > page with sessions. Registered globals is disabled so I am using the > > $_SESSION array to store session variable > > > > When I var_dump() $_SESSI

RE: [PHP] smarty

2004-04-08 Thread Kelly Hallman
Apr 8 at 7:38am, Aaron Wolski wrote: > I don't think this thread is tired. As someone who is about to dive into > learning templating more than what I do now... Tired in the sense that it had degenerated to a personal level that was uncalled for and off-topic. The merits of templating are never t

Re: [PHP] smarty

2004-04-07 Thread Kelly Hallman
Apr 7 at 10:22pm, John W. Holmes wrote: > > Uhhh, yeah--that's not templating, that's called spaghetti code :) > > +1 - Use of buzzword Right about here I could sense where this was going I don't know, what would you call it? Is there a non-buzzword term you'd be happier with? That term pre

Re: [PHP] smarty

2004-04-07 Thread Kelly Hallman
Apr 7 at 10:01pm, Robert Cummings wrote: > Smarty is a bit of a hack too... why do I need to declare my templates > within the PHP code? If I'm an HTML designer I'd like to create a new > page, include templates, use some data that's been made available and > have it all in the template. I sure as

Re: [PHP] smarty

2004-04-07 Thread Kelly Hallman
Apr 8 at 10:26am, Justin French wrote: > PHP itself is a great templating language :) > > > > > > > '> > Uhhh, yeah--that's not a templating, that's called spaghetti code :) You get the concept. Smarty, as you know, basically takes a Smarty template and writes PHP code similar to what you

Re: [PHP] smarty

2004-04-06 Thread Kelly Hallman
Apr 6 at 2:43pm, Chris de Vidal wrote: > Given that scripts are compiled the first time they're ran, you'll > never* notice the bloat and never lack performance; it's the same as > real PHP code and can be optimized with a caching engine like Zend. Certainly. However, the Smarty compiler is about

Re: [PHP] smarty

2004-04-06 Thread Kelly Hallman
Apr 6 at 5:33pm, Angelo Zanetti wrote: > hi all has anyone used smarty before? what do you think of it? I think > it's pretty nice to seperate your script (code) from your design. > i would like to hear your comments and if you have any alternatives There are a lot of templating systems for PHP, b

Re: [PHP] Tricky array question

2004-04-01 Thread Kelly Hallman
t loop over it as you like, to do your output. If you're reading an XML file, you might look into PEAR, which has packages for parsing and building data structures of XML data. -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] What's the use in OOP?

2004-03-29 Thread Kelly Hallman
it's a myth to think simply avoiding (delving into) OOP because "I've heard that it's slow in PHP" automatically means you're being more efficient. It's not the prime language for OOP but I find that when it all balances out, for web apps in PHP, OO offers an attractive

RE: [PHP] What's the use in OOP?

2004-03-29 Thread Kelly Hallman
ost would suggest against in PHP, anyway). There IS something to OOP! Unfortunately, it's difficult to learn through examples of car stereo panels or different types of fruit or trees (though they do make perfect sense in hindsight). -- Kelly Hallman // Ultrafancy -- PHP General Maili

Re: [PHP] Re: Are $_POST and $_GET interchangable?

2004-03-10 Thread Kelly Hallman
are really no specific rules. On that note, something to keep in mind is that GET variables (being part of the URL) are written to server logs. Depending on the data being passed, this could be a security issue (especially in a shared hosting environment where untrusted users may have access to the lo

[PHP] Return value efficiency question

2004-03-09 Thread Kelly Hallman
Consider this method: function xyz() { return $this->data = unserialize($this->serial); } A few assumptions: - Resultant data large enough to warrant discussion of efficiency - I always want to store the unserialized data into the object - The return value is only needed sometimes If

Re: [PHP] need form array help

2004-03-01 Thread Kelly Hallman
On 1 Mar 2004, Brian V Bonini wrote: > while ($result = mysql_fetch_array($dbresult_riderlist)) { > print('' . "\n"); > print(" $result["rider_id"] . '" />' . "\n"); > print(" $result["rider_name"] . '" size="15" />' . "\n"); > print(" $result["rider_license_cat"] . '" size="3" />' . "\n"); > print

Re: [PHP] Using a perl regex

2004-02-11 Thread Kelly Hallman
to escape something in the pattern, > but will look further. I think it means you need to put a delimiter around your regex... Typically you would use slashes (preg_match("/regex/")) but the character can be other than slash.. i.e. "not alphanumeric or backslash" :) --

Re: [PHP] auto forms from mysql database

2004-02-02 Thread Kelly Hallman
haunt you down the road.. Design the object well and it could validate the data automatically or contain other non-database data such as form headings, help text, etc. Also hooking this into some kind of form class (I like PEAR's HTML_QuickForm) may help speed things along... -- Kelly Hallman //

RE: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Kelly Hallman
ng OO with PHP simplified a lot of problems I'd had trying to do more complex tasks with a procedural/functional approach. I still use perl to whip up a sysadmin script here and there, but after using Python I began to regard perl as a syntactic mess. -- Kelly Hallman // Ultrafancy -- PHP G

RE: [PHP] OOP methodology{O|T} kinda'

2004-01-30 Thread Kelly Hallman
learn C++ before you're going to do much successful OOP with it. Not exactly a small learning curve. Other languages dispense with a lot of the formalities found in C++ (a good or bad thing, depending on your perspective). I found Python to be a great language to learn OOP, since it f

Re: [PHP] class design question

2004-01-12 Thread Kelly Hallman
it (it's the SQL queries themselves that are not always portable, so you have to solve that). If you've never looked at PEAR, the DB class is a good start. Also, despite all it's features, it's quite fast! -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] _("What does this do?")

2004-01-12 Thread Kelly Hallman
code (SquirrelMail) uses it in one place, but not another. What say you, PHP gurus? Gotta love the syntactic sugar! -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Re: jpeg Uploader issue

2004-01-12 Thread Kelly Hallman
ould set the Content-type header like so: header("Content-type: image/jpeg"); -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php doesn't work in html files

2004-01-11 Thread Kelly Hallman
don't mostly all contain PHP code. Same performance hit if you were naming plain HTML files as .php... -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] not sure why regex is doing this

2004-01-09 Thread Kelly Hallman
ave input like (), but it would work as expected. Many tricky regex problems can be solved by lookaheads. There is also a negative lookahead (?!pattern) ... also note that this is an advanced regex feature and won't it work on many regex engines not based on PCRE. -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Problem with Picture Name

2004-01-06 Thread Kelly Hallman
single place. Also, it includes defaults that don't need to be specified with each call, as you'd need to do with preg_replace() alone. -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Verifying a url

2004-01-06 Thread Kelly Hallman
r script... $is_secure = ($_SERVER['SERVER_PORT']==443) ? true : false ; If you decide to use SERVER_PORT to sense secure connections, this logic would work well. It only depends on knowing the port you consider secure. For typical https, that would be port 443. Enjoy! -- Kelly

RE: [PHP] if("NANC" < 0) - always evaluates TRUE...

2004-01-06 Thread Kelly Hallman
variable as an int also appears to result in the desired behavior: (int)"NANC" < 0 == false -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regular Expression

2003-12-27 Thread Kelly Hallman
idn't want are identical in your post, it was hard to tell what you were trying to do, but... I think this is what you want.. ereg_replace("(\.)([0-9])","\\1\\2",$string); (minus the last decimal point, missing from your original string) -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] header function, I'm stumped

2003-12-09 Thread Kelly Hallman
surprised I didn't see this mentioned.. Have you tried: header("Location: http://url.redirect/\n\n";); exit; // ? The browser may be particular about the headers. When you add the two newlines to the end, it makes it look like the end of the headers. It's good practi

Re: [PHP] restrict access to multiple pages

2003-12-09 Thread Kelly Hallman
ions would determine if the logged-in user had adequate permission, and redirect them if not. That way, you can control this behavior from a central location--you don't want to have to go through each page of your app and change a URL. -- Kelly Hallman // Ultrafancy -- PHP General Mailing

Re: [PHP] Problems downloading files via https in IE 6

2003-12-06 Thread Kelly Hallman
something I'm doing, or is this an IE problem? This is the workaround I use for the IE/https download problems. Not sure if it's the same problem, but let me know if this helps: -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Variable in $_FILES?

2003-12-01 Thread Kelly Hallman
close a string with '' it will be treated as a literal. You may also consider "object{$objectnumber}" if you need to avoid ambiguities with the rest of your string. I personally think it's a good habit to use the curlies anyway, but I'm sure that's a matter of d

Re: [PHP] php as cgi script

2003-11-28 Thread Kelly Hallman
line, but as a CGI by the webserver. -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regular expressions

2003-11-27 Thread Kelly Hallman
filter($data,$allowed) { foreach($data as $k => $v) { if (in_array($k,$allowed)) { $r[$k] = $v; } } return $r; } Putting it all together: $allow_keys = array("action", "page", "custtype", "gender"); $new_vars = array("page" => 3, "act

Re: [PHP] PHP Java extension--hopeless?

2003-11-26 Thread Kelly Hallman
On Wed, 26 Nov 2003, Rasmus Lerdorf wrote: > On Wed, 26 Nov 2003, Kelly Hallman wrote: > > I am aware that the PHP documentation says that the Java extension is > > experimental. I am also aware that people say the ISAPI version does not > > work well and that running PHP

[PHP] PHP Java extension--hopeless?

2003-11-26 Thread Kelly Hallman
ally be dropped from PHP? Plans to improve it? Thanks in advance for any help or pointers!! -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: A loop for the hours in a working day

2003-11-23 Thread Kelly Hallman
e showy and 2) feared the example would start losing it's demonstrative value with extra functionality. -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] ldap_search() question

2003-11-23 Thread Kelly Hallman
earch criteria it comes back with no hits. How should this be > done? Do I have to encrypt the password somehow? You probably need to use ldap_compare() to verify the password. Most LDAP servers won't send back the password field contents. Hope that helps! -- Kelly Hallman // Ultrafancy

Re: [PHP] Re: A loop for the hours in a working day

2003-11-23 Thread Kelly Hallman
t it's a little unweildy.. especially if you want to change the range later (changing the array may not be so bad, but then you've got to figure out how many iterations your loops must do, etc). How about something like this: $hstart = 7; $hend = 19; $interval = 15; for($h=$hstart; $h

RE: [PHP] echo or print

2003-11-21 Thread Kelly Hallman
ng very little of any, if you're working with more than a basic, one-page script. Even if you are (gulp) generating your HTML output within functions, it seems better to be returning that back to some level where there are only a couple of echo/prints necessary.. Think output layer...

Re: [PHP] strpos() act funny when searching for "]]>"....

2003-11-21 Thread Kelly Hallman
actly where it found it last time. So, naturally, you need to advance the character position by at least one to find subsequent occurences. This isn't a workaround. You had the bug. -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Adding X days to a time string...

2003-11-21 Thread Kelly Hallman
in a day (86400 * days) + timestamp -- Kelly Hallman //Ultrafancy/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Is there a way to use the strpos() for next string...

2003-11-20 Thread Kelly Hallman
ually parse it. To simply pull one or two values out of the file, a regex still might be the quickest/dirtiest.. If you do want to move forward testing parsers and stuff, make yourself a valid XML file to test with, so that is not the issue...worry about fixing malformed XML later with the pro

RE: [PHP] array_search

2003-11-20 Thread Kelly Hallman
requirement...? Maybe I'm not understanding the problem, but why not just use something like $myarray = preg_split('/[\r\n]+/', $textarea) ? -- Kelly Hallman //Ultrafancy/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Is there a way to use the strpos() for next string...

2003-11-20 Thread Kelly Hallman
're actually trying to write a parser, I think you might do well to read up on how other parsers work (like, using a stack). Anyway, don't do that, use an existing XML parser.. unless you are on a learning quest.. then, by all means! -- Kelly Hallman //Ultrafancy/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php