Re: [PHP] Rounded rectangle in php

2009-01-29 Thread ceo
Yes, you will need four ellipses, arcs, or similar shapes -- but they'll all be the SAME except for the center, so make that a function probably. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Updating time in php

2009-01-26 Thread ceo
I'll add that if you went the JS route, then it would just be replicating the system time, ie replicating the Windows clock. Actually, I did this thing once where I included the server time from PHP in the JS, then calculate the difference, then use JS to show the actual current time by

Re: [PHP] Java / PHP Bridge

2009-01-23 Thread ceo
Zero real experience, but what I hear is that the Java / PHP bridges are a bit brittle and difficult to shore up properly... You may want to consider going with HTTP REST / RPC services instead, as those are quite solid, and you can get what you want. Note that this is all hearsay on my

Re: [PHP] Java / PHP Bridge

2009-01-23 Thread ceo
And vice-versa: Any PHP functionality that needs to be called from Java can be a web service using whatever weapon you find suitable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] killing a child process from pcntl_exec

2009-01-22 Thread ceo
There are functions/settings in pcntl docs about how to listen for specific signals. If you don't listen for -9, maybe you don't get it. http://php.net/manual/en/function.pcntl-signal.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread ceo
there is an art to using them, they compliment 'traditional' error handling, and I agree they can hinder if used badly. I don't think I've ever seen Exceptions used well... Invariably, I end up having to write a wrapper function around every function implemented and catch all the

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread ceo
I prefer to deal with the issues locally, or have a documented behaviour with return values and error details available, much like most of PHP extensions/internals. try/catch ends up with weird code organization, imho, especially when you can only really handle some exceptions. For real

Re: [PHP] session mysteriously killed

2009-01-20 Thread ceo
Are you perhaps storing the session data in a DB? If the field type is, say, text, and you put something large in $_SESSION, you'll have truncated data, the session manager can't unserialize it, and you will have a silent failure when they try to do their next task -- They get logged out

Re: [PHP] PHP-Java Bridge: Connect PHP to MySQL using JNDI

2009-01-20 Thread ceo
In general, if you are trying to get DB connections to work in a hybrid situation, and no native driver is behaving, try ODBC. It's crude, slow, and not pretty, but it should work. You can set it up so that you can go back later and dink around with drivers and re-compiling, but at least

Re: [PHP] developers life

2009-01-20 Thread ceo
catch-all? Yes, with lots of spam filtering, including a custom one in PHP. Got tired of waiting for webmail to run its filters. PHP cron job on the server with IMAP. Comes in handy for web sign-ups and the following spam -- And for identifying spammers. I don't work with spammers.

Re: [PHP] Need List Advice

2009-01-19 Thread ceo
I think it means Rob has to bake us all some brownies and ship 'em out to us... :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP and Apache configuration

2009-01-19 Thread ceo
I doubt that you can use re-direct and do what you want, since a re-direct does just that: re-direct the USER to the URL. What you *could* do is get rid of the re-direct and just include('scriptfile.php'); by using ForceType on imagefile.jpg to be application/x-httpd-php Then

Re: [PHP] Undefined index error

2009-01-19 Thread ceo
There is no reference to index '2' in that line 19. What is the next line? Something which expects at least 3 elements in the URI, perhaps?... [Hint, hint] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] developers life

2009-01-19 Thread ceo
ESTJ Apparently, it's time for me to take on a project manager job and quit coding... Oddly enough, I've been thinking I might like to do that, though more of an architect/manager role, really... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] developers life

2009-01-19 Thread ceo
Apparently, it's time for me to take on a project manager job and quit coding... Oddly enough, I've been thinking I might like to do that, though more of an architect/manager role, really... didn't you already make that change when you became ceo of an intergalactic enterprise

Re: [PHP] Mirroring/caching PHP webpages.

2009-01-16 Thread ceo
It is not the case that they are running your old PHP code. Their messages may be passing through your filters. Save one of them and try it yourself, with a lot of debug echo statements or whatever you like. They may be accessing your old PHP file still on your server, if you left it

Re: [PHP] Quotes in querys

2009-01-14 Thread ceo
You can only interpolate ONE level of array or object indirection in a string. WORKS: ... $foo[x] ... ... $foo-x ... FAILS: ... $foo[x][y] ... ... $foo-x-y ... //almost for sure it fails, never tried... You can use curly braces in side a string to evaluate something: WORKS: ...

Re: [PHP] Re: ArrayObject - Posibillity to add key = value pair per default?

2009-01-14 Thread ceo
In olden times, of PHP 3, you could for sure use -x and [x] interchangeably, as an Object then was little more than a C struct with a couple functions tacked on, as was an array. I think PHP 3 Object may actually have been implemented as a PHP array with some additional C functions on it,

Re: [PHP] Re: iconv is messing up a spreadsheet generated by the Spreadsheet Excel Writer

2009-01-14 Thread ceo
The charset: latin1 and the collation: latin1_swedish_ci. Trivia quiz at a MySQL presentation at my Chicago PHP User Group a few year ago comes in handy! The defaults for MySQL are actually latin1_swedish as that is the native language of the original developer, (?Monty Widenus?) This

Re: [PHP] Quotes in querys

2009-01-14 Thread ceo
Doesn't anybody use prepared statements these days? It even helps MySQL AND Oracle cache an execution plan... Forgive me if I'm wrong, but: Caching an execution plan for a prepared statement that is run only once in the script is just overhead, no? Or can it actually re-use the same

Re: [PHP] Basic Authentication

2009-01-14 Thread ceo
What it is depends on what encryption routines you have installed. The algorithm to authenticate detects the algorithm based on the hash. 32-char : MD5 $1$ : SHA-1 $2$ : SHA-2 etc. (Apologies if I got my tokens/algorithms wrong) If you just toss MD5s in there, it should work,

Re: [PHP] PHP, Smarty, and Text

2009-01-14 Thread ceo
One way to balance the author's need to have nice-looking output, and your need to keep the content/html under control is to provide the authors with a variety of template layouts with varying number/placement/sizes of images and blocks of text. Build a half-dozen of them, allow only ASCII

Re: [PHP] PHP unlink Permission Error

2009-01-13 Thread ceo
Not only do you need to check the return value of chmod to see if it worked, but also, I *think*: The file withing the directory can have entirely different permissions, and making the directory world writable won't help that, I don't think... I could be wrong, and a 000 file in a 777 dir

Re: [PHP] ecommerce related question

2009-01-13 Thread ceo
For now, as already said, go with PayPal or similar. Do not store the CC#s in your DB or anywhere at all, for any length of time. Not in the SESSION either. Get it and send it to PayPal and wipe it out with http://php.net/unset all in one single HTTP request. For long-term, to learn

Re: [PHP] PHP unlink Permission Error

2009-01-13 Thread ceo
touch foo.txt chmod 000 foo.txt rm foo.txt rm: remove write-protected regular empty file `foo.txt'? So the behaviour is at least partially shell/profile dependent... I have no idea how this would affect PHP unlink, if at all. ymmv naiaa ianasg [*] [*] sg: shell guru -- PHP

Re: [PHP] Suggestions?

2009-01-13 Thread ceo
Hard to say without knowing the data structures... You can't do a simple count of the holidays and add that, because you might end up with yet another holiday in the result. Start at 12/23 and want to add 6 business days. You find 1 holiday in between, so you add 7 business days and end

Re: [PHP] switch vs elseif

2009-01-13 Thread ceo
I think if they didn't want us to use expressions in the case, then they wouldn't have put support into the language for that. I daresay you are reading more into the text than was intended... I certainly have found switch(true) with complex expressions for case quite handy and very clear

Re: [PHP] Couple of beginner questions

2009-01-12 Thread ceo
$ mv hello-world.php hello-world.html Isn't this backwards?... :-) 39% seems awfully high overhead for what is essentially an extra readfile. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] is_readable() returns 1 if file is still uploading

2009-01-12 Thread ceo
You should be able to fairly quickly fopen/fread/fseek/fread and compare the opening/ending XML tags. If it's well-formed XML, it should be trivial to detect an incomplete file versus a complete one. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Editing in a text area field

2009-01-12 Thread ceo
Google for BBCode. It's just str_replace(array('[b]','[/b]'),array('b','/b'),$text) in the end. And it's not really going to be any better than just letting them type b and /b if that is needed. Your sanitization process will be the same no matter what, and will have the same

Re: [PHP] RSS feeder in PHP5?

2009-01-12 Thread ceo
You actually mean application/xml not text/xml That depends on if you want the Userland RSS standard or the Other [blanking on name] RSS standard. Unfortunately, the RSS camps are still at war over syntax and required elements, and there are 9 mutually-incompatible often-used versions of

Re: [PHP] Couple of beginner questions

2009-01-12 Thread ceo
are you really ever in a situation where some HTML weenie is coding HTML pages and you're somewhere else doing the PHP work? Yes. I have been there several times, and am there now. In a well-run organization with good communication and a decent framework, it works out well.

Re: [PHP] downloading xls files corrupts them

2009-01-12 Thread ceo
For starters, three calls to header(Content-type: ); is just plain silly :-) Read this for sure: http://php.net/header You may find this interesting, or not, to pick the right Content-type http://richardlynch.blogspot.com/2006/06/php-downloads-content-disposition.html -- PHP General

Re: [PHP] Adressing XML Objects

2009-01-09 Thread ceo
Try it with just one / at the start of the xpath. /anbieter/immobilie/... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Editing in a text area field

2009-01-09 Thread ceo
Rule #1. Never, ever, ever, alter the user's input, EXCEPT for sanitizing/filtering. Specifically, do NOT add br / tags in place of newlines. Store the newlines. Upon OUTPUT, you can use nl2br() to get br / tags. Or str_replace if you want /p instead. This is crucial as a habit, down

Re: [PHP] imagejpeg, imagecreatefromjpeg both choke

2009-01-09 Thread ceo
Do other images work? Open and re-save the image. Strip out comments and EXIF data while you are at it -- Some versions of GD had problems with EXIF/comments as I recall. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Create image from HTML

2009-01-09 Thread ceo
I know there was an OSS package that took any URL and made a screenshot of it... Thumbnailer or somesuch?... Commercial folks do it. http://browsercam.com/ Compare cost to dev costs for roll your own... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Couple of beginner questions

2009-01-09 Thread ceo
The slowdown of just running raw HTML through PHP was once benchmarked as about 5 to 10 %. You could, in theory, use .htaccess and Files to ForceType specific .html files as PHP, while leaving the rest of your .html files as static. I am not recommending this, just being pedantic. :-)

Re: [PHP] imagejpeg, imagecreatefromjpeg both choke

2009-01-09 Thread ceo
The browser cheerfully rendering a badly-broken JPEG is quite common, if it can figure out what the JPEG was supposed to have been. (Think bad HTML and quirks mode.) So you really want to validate it with something more strict than a browser. -- PHP General Mailing List

Re: [PHP] Editing in a text area field

2009-01-09 Thread ceo
Rule #1. Never, ever, ever, alter the user's input, EXCEPT for sanitizing/filtering. Probably shouldn't recommend sanitizing then. Only validate reject. :P mea culpa I meant ESCAPING, of course. If it doesn't pass sanitizing/filtering, it's probably better to just reject and

Re: [PHP] Couple of beginner questions

2009-01-09 Thread ceo
With all due respect, Eric, you're not testing what we're discussing. A real CLI test would be more like: time cat foo.html time php -q foo.html I.E., how long does PHP take to read/write foo.html without breaking into PHP mode for static HTML. Of course, it's still a lousy

Re: [PHP] Couple of beginner questions

2009-01-09 Thread ceo
I'm talking about having PHP rip through .html files without any ?php echo *;? inside of them. You added ?php echo *; ? Don't do that. :-) ln -s foo.html foo.php Surf to both and time it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Convert CMYK values to RGB values?

2009-01-09 Thread ceo
Short Answer: You can't. :-) http://en.wikipedia.org/wiki/CMYK Long Answer: You probably can, but not in some way that makes sense to discuss here on PHP-general. The external links in the above article should get you started. -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Re: hello

2009-01-08 Thread ceo
Fact is if you want to be secure just disconnect you're machine from the internet, remove cd/dvd/floppy drives and unplug the keyboard. You forgot to cut the internal USB cables. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] how does one bind a gui representation and a container object.

2009-01-08 Thread ceo
You'll have to use Ajax to make another HTTP request. HTTP is not really designed for this, and it will make the site quite sluggish most likely... You should certainly make it an async call and not slow users down with this feature. -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Request A Collection of YouTube Videos From Multiple User Accounts using YouTube API

2009-01-07 Thread ceo
It is the wrong list to ask. The answer is that the YouTube API does not support that. You'll have to merge and sort in PHP. I recommend you cache the results for all external web services, as a general principle. For a large number of videos, you'll want to merge/sort in DB, not in

Re: [PHP] Remote File Variable Injection Safety?

2009-01-07 Thread ceo
If register_globals is on (ewww!) at otherhost.com, then ?safe_flag on the URL will get in. This is one of the reasons why register_globals should be OFF. NOTE: The code you gave does not describe the circumstances whereby $safe_flag is set. There could be all manner of other issues

Re: [PHP] php-gtk2, anyone?

2009-01-07 Thread ceo
Irrespective of the GTK2 bit, PHP can connect just fine with other servers using sockets and stream wrappers and good ol' file_get_contents on a URL. Whether you can tweak those in useful ways at fast enough speeds to do what you want is more up to your skill than PHP's feature-set. --

Re: [PHP] trigger_error() when using php cli

2009-01-07 Thread ceo
As I recall, PHP CLI overrides the error_log setting and uses STDERR by design. You'll have to re-direct it elsewhere in the shell. Or a custom error_handler that uses a specific file name in error_log call. Using error_log alone will not help. -- PHP General Mailing List

Re: [PHP] XML package on PHP

2009-01-07 Thread ceo
XML in PHP4? Don't. :-) It was very painful and with all kinds of quirks, from my limited experience. PHP5 was a breeze. Consider hosting a quick/easy service on a PHP5 box to convert XML to PHP serialized data or something as well. Could be less painful. Or just upgrade, since PHP4

Re: [PHP] get file from object

2009-01-06 Thread ceo
As far as I know, that's not readily available... However, you could do an ob_start() and/or a try/catch and try to re-define the class, and then ignore the error and continue. I believe the PHP error message you get will have the file and line where the original class was defined, so you

Re: [PHP] MySQL client version problem

2009-01-05 Thread ceo
PHP had a built-in MySQL for awhile as I recall. You had to explicitly use --with-mysql=/usr/local (or wherever you put your mysql headers/libs) to make it choose the one you wanted. Even if it's not using built-in, it may have found an old install of your MySQL rather than your shiny new

Re: [PHP] Re: Re: How to count transfered kBytes in File-Download

2009-01-05 Thread ceo
I'm still a little confused on this though. How would a browser send this to notify of a download that was only partially completed before? As I understand it, it was more of a partially cached document issue. If the browser has the first N bytes of a document in its cache, it will send

Re: [PHP] How to count transfered kBytes in File-Download

2009-01-05 Thread ceo
echo fread($HANDLER, $FSIZE); This is your problem child right here... Sucking in an entire OGG File to RAM, for a large OGG file, will be quite painful. And, on a busy server, even moderate size files will be problematic. You could probably relieve a lot of stress and keep

Re: [PHP] MySQL client version problem

2009-01-05 Thread ceo
Historically, mysql has been both an external extension, and a built-in part of the source, depending on the version of PHP. Your current experience would indicate that it's only external in 5.2.8, but I cannot confirm nor deny that. How is MySQL installed? If it's rpm, do you have

Re: [PHP] How to count transfered kBytes in File-Download

2009-01-05 Thread ceo
When mentioning the RAM usage problem, one might consider calling flush() after each echo, just to make sure that they don't run over PHPs memory limit. Oh yeah. Make sure you've run through and cleared all ob_buffers for any kind of non-HTML output, specifically for file downloads.

Re: [PHP] IE Problem Detecting Post Variables

2009-01-02 Thread ceo
My thesis is: Your Javascript that intercepts the .submit and then does whatever it does, is broken in FF but not in MSIE. Post your JS to a JS mailing list and ask there to be sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Is MD5 still considered safe for storing application user passwords?

2008-12-31 Thread ceo
For a bank? No, MD5 would not be acceptable. For you gramma's blog? Sure, MD5 for passwords is fine. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Encryption/decryption of PHP data

2008-12-31 Thread ceo
As I understand it: You can LINK your commercial binary with GPL binaries, and keep closed source. You cannot co-mingle the two C source codes together and keep it closed. I am fairly certain you can find commercial C++ offerings to generate PGP key pairs, instead of using the GnuPG OSS

Re: [PHP] PHP telnet server

2008-12-31 Thread ceo
I often thought PHP would be a nice language for a MUD, if one could get the performance out of it... Design your code such that you can just throw more hardware at it whenever you need more performance. That's easily said, but a MUD means all the users have to share a significant

Re: [PHP] =.='' what wrong ? just simple code, however error.

2008-12-31 Thread ceo
If it's money, store everything in pennies INTEGER, and format as dollars on output. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] IE Problem Detecting Post Variables

2008-12-31 Thread ceo
Whatever is SENDING the request data is broken, almost for sure. PHP doesn't *do* much to the HTTP Request data except urldecode it for you. There's not much that can go wrong there. If your theme switcher, presumably in JS, isn't sending the data properly, there's not much PHP can do

[PHP] When is an Exception not an Exception?

2008-12-31 Thread ceo
We have code like this: try { $details = $this-__client-getData($email); //Line 274 } catch (SoapFault $sf) { //do stuff } catch (Exception $e) { //do more general stuff } SoapFault: No data found in C:\classes\Client.php on line 274 Hello? What is the point of all

Re: [PHP] When is an Exception not an Exception?

2008-12-31 Thread ceo
I'm afraid I wasn't clear enough. I thought the catch block was not actually 'catching' anything, since I'm seeing an error message with the line of code that is causing the Fault. Turns out, XDebug is kindly splatting out the exception even though it's being caught. Which I'm sure it

Re: [PHP] PHP telnet server

2008-12-30 Thread ceo
I often thought PHP would be a nice language for a MUD, if one could get the performance out of it... 'Course you could always write some of the heaviest bits as extensions... Anyway, I don't think you need the connections to be shared in any special way. Just update your data store

[PHP] Re: Segmentation fault in php5-imap

2008-12-29 Thread ceo
Perhaps compile everything in debug versions and get some core dumps and file a bug report at http://bugs.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Where I can find the PHP5 grammar/specification?

2008-12-29 Thread ceo
The PHP source uses bison/flex, I believe, so that's your best bet for finding the grammar. Chris Shifflet (sp?) mentioned the other day somewhere that he was considering soon releasing some code that he uses in security audits for the boring grunt work part. You may want to try to

RE: [PHP] Re: imap_rfc822_parse_adrlist problem

2008-12-28 Thread ceo
File a bug report at http://bugs.php.net You have a pretty clear-cut case of a built-in function gone awry, and it will probably be fixed pretty fast. I also rely on this function quite a bit, so it needs to work right when I end up at 5.2.8 some day :-)

Re: [PHP] utf8 php howto?

2008-12-19 Thread ceo
For IE, you also want to add the META tags for HTTP-EQUIV for you charset. In some circumstances, with mixed charsets on a page, and with IE in quirks mode, IE will try to guess the charset and get it (very) wrong. You really do want a DOCTYPE and a document that validates if at all

Re: [PHP] utf8 php howto?

2008-12-19 Thread ceo
In some circumstances, with mixed charsets on a page, and with IE in quirks mode, IE will try to guess the charset and get it (very) wrong. A single page or response can only have one characterset, there is no mixing possible. Allow me to re-explain. Step 1. Generate HTTP

Re: [PHP] Re: HTTP Error 500 - IsapiModule

2008-12-19 Thread ceo
Sorry didn't try your suggestion php -1 ... not sure how to!! Open up MS-DOS prompt. Figure out where your php.exe lives. Let's pretend it's in C:\\php5\php.exe cd to the directory where your script lives. cd C:\\inetpub\wwwroot\search C:\\php5\php.exe -l search.php After

Re: [PHP] search for person by comparing his data with data in mysql

2008-12-19 Thread ceo
select first_name like '%$first_name%' + 3 * last_name like '%$last_name%' + 7 * email = '$email' as score, first_name, last_name, email, person_id from person . . . order by score desc limit 10 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: runtime access to static variable

2008-12-18 Thread ceo
Unfortunately, in the inherited DeployTask::execute(), self::$STEPS does not refer to UpdateTask::$STEPS, it refers to DeployTask::$STEPS Use parent::$STEPS and call it done? Yes, I know, if you add another layer of class in between, then it's not parent:: anymore, but it seems a bit

Re: [PHP] fread question

2008-12-18 Thread ceo
PHP does *not* do the addslashes on $_POST when you cram something into it in your PHP code. It does it during the process of auto-filling up $_POST. So either: A) you have magic_quotes_runtime turned on LOCALLY. Use phpinfo() to see. B) you actually managed to put the backslashes into

Re: [PHP] Read/decode barcodes from an image

2008-12-18 Thread ceo
AIUI: The barcodes are on faxes and whatnot, with no predictable skew, position, nor orientation. You've tried JOCR/GOCR, and they don't do very well. Here are your options: 1) Shell out the money for that PaperPort OMNI or whatever it is commercial OCR product. It *is* better than

RE: [PHP] Read/decode barcodes from an image

2008-12-18 Thread ceo
Certainly if the quality of the input can be improved by using some digital transfer that is not a fax, go for it... I assumed the OP already knew that, but perhaps not. The fax is going to cost you a LOT of accuracy, probably too much to make OCR even viable, really, but it depends on

Re: [PHP] error flashing on redirect

2008-12-17 Thread ceo
Change php.ini (or .htacces or ini_set) so that display_errors is OFF and log_errors is ON and log them to some file you do this to, all day, every day: tail -f /var/log/httpd/error_log You'll definitely need this as you get more complex site interaction, particularly with Ajax calls that

Re: [PHP] dynamic forms

2008-12-16 Thread ceo
If you have their ID when you generate the HTML FORM, there is no need for anything as exotic as Ajax... //get their $ID //query the DB using $ID to get $whatever echo TEXTAREA, htmlentities($whatever), /TEXTAREA; If you don't know their ID until the interact with other form elements,

Re: [PHP] FPDF Printing Ideas?

2008-12-16 Thread ceo
Just generate a much larger PDF with all the pages they asked for and call it done. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] runtime access to static variable

2008-12-16 Thread ceo
Try this, maybe: ($className)::$STEPS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] new xampp server problem w/mail

2008-12-15 Thread ceo
Assuming your local box is not wide open to the 'net for mail relaying, install Pegasus/Mercury mail server and call it done. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Need a brain to bounce some Mysql/DB thoughts off of!!

2008-12-12 Thread ceo
I would set it up that a person could elect to work with one or more Departments. If they work on a College, they work on all Departments in that college. Another option is to just let them do one Dept at a time, and that's it. Kind of depends on what people actually DO in this work,

Re: [PHP] Can GD make a JPG thumbnail of a PDF?

2008-12-11 Thread ceo
If system(convert -version) does nothing, it is probably erroring out. Mess around with exec and using 21 to try to get the error message. It's going to boil down to paths and permissions. The PHP user probably doesn't have convert in $PATH. Use a FULL PATH for system/exec calls for

Re: [PHP] usort for sorting an array of objects

2008-12-10 Thread ceo
You can use a (base) object Comparable with a method compareTo as the callback function for http://php.net/usort That gives you 99% of what you want, for the tiny price of having to pass in the array('Comparable','compareTo') as the callback arg. Given that one frequently calls usort and

Re: [PHP] foreach and destroying variables for memory saving

2008-12-10 Thread ceo
PHP does have garbage_collection, and it's crucial in long-running CLI scripts. Per is right, though, in that if your web-page Apache PHP script needs GC, you are doing something terribly wrong. It is not as aggressive/thorough as, say, the Lisp GC, but it's there. ymmv -- PHP

Re: [PHP] usort for sorting an array of objects

2008-12-10 Thread ceo
Inefficiency for me is when it takes longer to code. How long can this take? Even if you go full-blown with an Interface and static methods that have to be fleshed out in the implementations, you're still talking about an hour or so. Quit complaining and start typing. :-) PHP is a

[PHP] Re: Poll of sorts: Javascript Form validation or PHP

2008-12-09 Thread ceo
Being JSON immediately parsable by both Javascript and PHP it is possible to exploit it to keep the regular expressions for the input fields in a single place, and avoid mantaining them synched between the Js and PHP scripts! Yes, but... The Regex engines are not the same, so you

Re: [PHP] A MySQL Question

2008-12-09 Thread ceo
Perhaps you couldn't hear the big bang in this universe, but what about in the universe that spawned it? :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] echo SESSION var doesn't work if unset after echo

2008-12-09 Thread ceo
Fire up Live HTTP Headers in Firefox. My theory is that the browser is RE-requesting the data because of the private, must-revalidate. So it goes like this: Browser - GET - Ecomm: fooie ; unset Ecomm Browser - GET - Ecomm: [not set] If you are using Ajax and JS and whatnot, the

Re: [PHP] file_exists and wildcard/regex

2008-12-09 Thread ceo
I'm not sure how glob works in the guts, but I know it is dog-slow for large numbers of files (or maybe just large numbers of results). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] A MySQL Question

2008-12-08 Thread ceo
Presumable, the EXISTS sub-query can be optimized sometimes to just stop processing the sub-query and kick things back out to the outer query. IN has to process them all and find them all. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Request to bash/jump/screw my code

2008-12-08 Thread ceo
* Your output isn't cleaned up when coming from the database. You need to put a few stripslashes() instances in there. Actually, if you think you have to use stripslashes, then, in fact, you've used addslashes and/or Magic Quotes TWICE, and your db has BAD DATA in it. Fix the data

RE: [PHP] Help with IF ELSE

2008-12-05 Thread ceo
Please do NOT use addslashes. Replace it with this: http://php.net/mysql_real_escape_string It is CRUCIAL if your database might maybe ever consider going international and having charset other than ISO-8856-1 or Latin1 [or the MySQL default of Monty's native language, which is very

Re: [PHP] Will not report errors what can I do

2008-12-05 Thread ceo
$result = mysql_query($query) or die(report($query,__LINE__ ,__FILE__)); // to show dB errors == function report($query, $line, $file) { echo($query . 'br' .$line . 'br/' . $file . 'br/' . mysql_error()); } This does two

Re: [PHP] PEAR Help

2008-12-05 Thread ceo
I found the PEAR tarballs to be corrupt a day or two ago... The PEAR bug report captcha continually rejected my correct answers to simple math questions. :-( I snagged a re-packaged version from: http://pizzaseo.com/ ymmv -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Accessing the 'media' attribute in php

2008-12-03 Thread ceo
but I gather from your reply that the browser issues the new (printer) page without reference to the server. Is this what actually happens? Yes, this is what actually happens for the browser print button. You could do something like a Printer Friendly button to generate a PDF on the

RE: [PHP] How to type arguments

2008-12-03 Thread ceo
I'm surprised nobody mentioned: http://php.net/assert in this thread yet. Perhaps I missed it? You should really consider doing this: 1) At the outer API layer, do a typecast (possibly with preg_match first) to convert the input data to acceptable form. 2) For inner API layer[s],

Re: [PHP] imap4 search criterias

2008-12-03 Thread ceo
As I recall, there needs to be a \SENTSINCE instead of just SENTSINCE, and the PHP online manual ended up stripping out the \ business... Or maybe that was in some kind of flags somewhere else... Check the user contributed notes -- Those are invaluable for what can go wrong type of

Re: [PHP] SELECT into array of arrays

2008-12-03 Thread ceo
I actually would do more like: $myArray[$study][$symbol] = true; No need to call in_array. Probably won't matter, really, but it's a good practice for when you end up doing the same kind of code for an array with thousands of elements. -- PHP General Mailing List

Re: [PHP] $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread ceo
There are httpd.conf settings to reject POST requests, but I don't think it would behave like that... But maybe it's a bit more complicated than what I've ever seen for httpd.conf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

  1   2   >