Re: [PHP] Simple PDF manipulation

2006-12-27 Thread tg-php
Yeah, this is exactly what we do at my work. We have a license for PDFLib and essentually we load blank forms and then say take this text and position it at this location. Kind of like putting words on a clear piece of acetate and overlaying it on top of a piece of paper. If I recall, we had

Re: [PHP] newbie question regarding URL parameters

2007-01-05 Thread tg-php
You'll probably get 50 answers to this, but here's probably what happened. There's a setting called "register globals" that will turn your name=me and age=27 into $name = "me" and $age = "27". It used to be turned ON by default. This was generally considered to be bad security, so it now defa

Re: [PHP] mssql_* overhead

2007-01-10 Thread tg-php
I thought the same thing as Jochem... that resources like database connections, couldn't be stored in $_SESSION. You say that's how you have (had?) it set up and it was working, but still sounds wrong to me. As for connections.. definitely don't open a new connection every time you run a functi

Re: [PHP] running exec() on client

2007-01-16 Thread tg-php
First.. I apologize for power-reading your message and not really grasping everything you're trying to do. From the responses, it sounds like my vote would be for PDF as well, being a very universal format and very easy to work with and makes small enough for your needs. If a file is still to

Re: [PHP] sms through teleflip and php?

2007-01-16 Thread tg-php
I'm guessing the SMS system is rejecting the email because it's lacking some headers that mail programs tend to use... and spammers sometimes forget. You might send your email from Thunderbird.. CC yourself on it. Verify that it went through as a text message, then open the CC'd copy and look a

Re: [PHP] sms through teleflip and php?

2007-01-16 Thread tg-php
Maybe phpMailer isn't sending the correct headers either. Sometimes all it takes is one missing header that a system is looking for and it may filter it as spam or something. Again, I encourage you to examine the headers from your Thunderbird "good" email and compare it to your PHP and/or phpM

Re: [PHP] md5

2007-01-17 Thread tg-php
MD5 is a hasing algorithm.. one-way.. really only good for checking known values and keeping them 'private', like storing passwords in a database. That way, if someone breaks into your database, they don't get the passwords, only the non-reversible MD5 hashes of the passwords. To check a user

Re: [PHP] md5

2007-01-17 Thread tg-php
Still.. that has nothing to do with how well known MD5 is (so I stand by my point).All these databases are is a giant list of pre-MD5'd strings. Brute force stuff, no magic behind it that allows for reversing MD5. You could technically do that with just about any crypto or hashing system.

Re: [PHP] most powerful php editor

2007-01-21 Thread tg-php
God I love this list.. great answers everyone! (serious and non-serious :) In addition to the editors listed, here's a few more to consider: Crimson Editor - my personal favorite when I don't need code completion. Code highlights for many different types of code (including my beloved LUA files u

Re: [PHP] OT - Leaving

2007-01-23 Thread tg-php
Best wishes John! We'll hold the fort and keep fighting the good fight in your absence. :) Good luck to ya! -TG = = = Original message = = = Howdy ladies and gents: For the past 9 or so years, with one email account or another, I have been subscribed to the PHP General Mailing List. Wel

Re: [PHP] bit wise math? Is there a function to easily return the bits?

2007-01-25 Thread tg-php
If there isn't a function to do exactly what you want, you could use dec2bin() to at least get the binary and work from there: http://us3.php.net/manual/en/function.decbin.php -TG = = = Original message = = = Is there a php function I can call to pass in a number and get the values returned?

[PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread tg-php
My contribution to the insanity.. INSERT statements made easy: $genericQY = "INSERT INTO MOD_LMGR_Leads ("; $genericQYvalues = " VALUES ("; $genericQY .= " FirstName,"; $genericQYvalues .= " 'John',"; $genericQY .= " LastName"; $genericQYvalues .= " 'Smith

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread tg-php
Strangely enough, Stut and Jochem, I DO find this more readable. Hah. I know, I'm insane. I have done it the way you guys proposed, using an associative array and using the keys and values as the columns and insert values. While that is what I'd call "tighter" code and when you understand what

Re: [PHP] OT - PHP Code Search

2007-02-01 Thread tg-php
Not too many ads on the pages after you find what you're searching for, and mostly just some "ads by google" type stuff. Speaking of Google.. you can also go here for PHP code searching.. I do all my "cod" (sic) searching there! Fresh! http://www.google.com/codesearch?q=lang%3Aphp&hl=en&btnG=S

Re: [PHP] _GET('name') truncates

2007-02-05 Thread tg-php
I'll let everyone else do the "why the hell are you doing this? security blah blah! bad practice blah blah!" type stuff.. I'm sure there will be plenty. One reason this may be happening is, depending on your browser, there's a limit to the number of characters you can have in a URL. That seem

RE: [PHP] base64-encoding in cookies?

2007-02-07 Thread tg-php
Exactly what I was going to mention, Brad. Here's some more info. Quoted from PHP manual for urlencode(): "Returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. It is enco

Re: [PHP] Sorting issue

2007-02-07 Thread tg-php
Well, kind of ugly but you can do something like this: SELECT Position, CASE Position WHEN 'CEO' THEN 1 WHEN 'COO' THEN 2 WHEN 'CFO' THEN 3 WHEN 'HR' THEN 4 ELSE 99 END AS PositionSort FROM SomeTable ORDER BY PositionSort That way you're not creating a whole new table to store the sorting value

Re: [PHP] Text Editor for Windows?

2007-02-08 Thread tg-php
Lots of good recommendations have been made.. I just wanted to toss one more into the mix. It hasn't been updated in years, but does a fantastic job, and so far I havn't been lured by Notepad++ or any of the others enough (even after trying them) to switch. Check out Crimson Editor when you ge

Re: [PHP] Sorting issue

2007-02-08 Thread tg-php
Paul's probably right.. putting the sorting values in a table would be eaiser to maintain. I don't know what I was thinking with the whole "then you don't HAVE to create a table". Both ways work.. but especially if you think the positions may change, then it'll be tons easier to update if th

Re: [PHP] round to nearest 500?

2007-02-12 Thread tg-php
$num = "749"; $rounded = round($num * 2, -3) / 2; echo $rounded; -TG = = = Original message = = = Is there an easy way in php to round to the nearest 500? So if I have 600, I 500 and if I have 800 I want 1000? Thanks! ___ Sent by eProm

Re: [PHP] print() or echo

2007-02-13 Thread tg-php
As referenced in the manual ( http://us2.php.net/manual/en/function.echo.php ), check out this url: http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40 Short story, there is a difference, but the speed difference is negligable. If anyone cares, I prefer echo too. Not sure why. Shorter

Re: [PHP] print() or echo

2007-02-13 Thread tg-php
"negligible".. blarg spelling. :) = = = Original message = = = As referenced in the manual ( http://us2.php.net/manual/en/function.echo.php ), check out this url: http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40 Short story, there is a difference, but the speed difference is negliga

Re: [PHP] how do I just escape double quotes within a string?

2007-02-13 Thread tg-php
You could use addslashes(): http://us3.php.net/manual/en/function.addslashes.php Or, the code you mentioned below, could be rewritten like: str_replace("\"","\\"",$code); or str_replace('"','\"',$code); And if you're doing it for a MySQL query call, then you want to use mysql-real-escape-string(

Re: [PHP] round to nearest 500?

2007-02-13 Thread tg-php
For downward rounding, you'd always want to use floor() and use ceil() for rounding up. round() rounds up on a 5, down on a 4 and below. Example: echo round(141.074, 2); // 141.07 echo round(141.065, 2); // 141.07 I thought round() (or maybe it was a rounding function in another language or

RE: [PHP] round to nearest 500?

2007-02-13 Thread tg-php
hah yeah, always worth a little skepticism, but it seemed to make some kind of sense. If you always round up or always round down, that's obviously not right and you end up losing potentially a lot of money or over-estimating the money involved. Founding up for 5 through 9 and down for 0 thro

RE: [PHP] round to nearest 500?

2007-02-13 Thread tg-php
Ok, screw work.. it's snowing out anyway (not that that makes a real difference to doing PHP work inside), curiosity got the better of me. btw.. the "banker" rounding code here was pulled from the round() manual page. It's not what I read before, but it's the same concept: function bankers_rou

Re: [PHP] round to nearest 500?

2007-02-13 Thread tg-php
Ahh.. good call. http://en.wikipedia.org/wiki/Rounding Apprently it's called "banker's rounding" or "statistician's rounding" and is a little more complicated than just looking at the odd/even of the digit being arounded. This is starting to get into some heavy math theory and scary stuff tha

Re: [PHP] round to nearest 500?

2007-02-13 Thread tg-php
I don't buy "zero doesn't count". But again, this is getting into serious math. It should be good enough to say 0-4 = 0, 5-9 = 10, but if you don't keep strict high precision throughout the whole process and round at every step, things are going to be off no matter what. It's just a matter of

Re: [PHP] WHERE problem

2007-02-20 Thread tg-php
Different strokes for different folks... Might I toss a new recommendation into the mix? SELECT text FROM fortunes ORDER BY RAND() LIMIT 1; = = = Original message = = = N~~meth Zolt~~n wrote: > 2007. 02. 20, kedd keltez~~ssel 08.17-kor Jim Lucas ezt ~~rta: >> Mike Shanley wrote: >>> I'd like

RE: [PHP] WHERE problem

2007-02-20 Thread tg-php
Ah.. sorry Jay. I had like 8,000 emails today and must have missed some of the original responses. Or maybe I'm just trying to look smart by riding on your coat-tails. Either way, apologies for the repeated information. -TG = = = Original message = = = [snip] Different strokes for different

RE: [PHP] Getting Similar rows from db

2007-02-23 Thread tg-php
I don't think there's a way to do it with SQL in MySQL. Jay's talking about a substring search within a field and what you really want is to know if two whole rows (multiple columns) within a database are similar or not. You could pull in all the data and use PHP to figure out what's similar (b

Re: [PHP] PHP 5.2.1: Some scripts are being parsed, but most aren't

2007-03-28 Thread tg-php
I've seen an issue similar to this a few times recently. It involved a phpBB board I log onto periodically. It seems that the server is really slow and after what seems to be a timeout period, sometimes I'll get a download request in Firefox. If I let it download, I get an empty file. I was

Re: [PHP] Form Handler Script Security Discussion

2007-03-29 Thread tg-php
Good topic. It's touched on here and there in other questions, but always good to hit it head-on from time to time too. First, mysql_real_escape_string() for inserting into MySQL and whatever equiv you can find for whatever other database you may be using. addslashes() isn't so hot for databa

Re: [PHP] Form Handler Script Security Discussion

2007-03-29 Thread tg-php
You can pass session ID data via the URL. Ugly as it is, that's a viable option (that I see used a lot actually.. kinda drives me nuts but I understand it) for when you don't have people logging in and/or can't guarentee that cookies will be available. As was mentioned a few times, CAPTCHA met

Re: [PHP] Audio CAPTCHA review request

2007-03-29 Thread tg-php
It played the same sequence for me when I re-clicked the Play button.. until I went away for a min or two and my session probably timed out. Did it not play the same sequence for you? -TG = = = Original message = = = Just a really quick check right now is all I have time for, but it looks g

Re: [PHP] Audio CAPTCHA review request

2007-03-29 Thread tg-php
Not bad. Seems to work nicely. No "OMGWTF!" obvious slips like naming the MP3 with the digits the user needs to enter. Worked fine in Firefox 1.5 too. Sometimes when audio is embedded in a page, it tries to load Windows Media Player or something which doesn't always work well in Firefox withou

Re: [PHP] Alternative/Addition to using a CAPTCHA

2007-03-30 Thread tg-php
I agree with Tijnema on the fact that visual positioning doesn't really matter to the bots. They don't really "see" the page the way we see it. Most tricks you're going to try using HTML and JS are going to be readable by a bot. You could take your example and replace the alert() with a window

Re: [PHP] Re: Alternative/Addition to using a CAPTCHA

2007-03-30 Thread tg-php
Maybe I'm missing something.. if the intent is to have 'hidden' fields that a user would end up submitting but a bot wouldn't.. that wouldn't work very well. A bot could easily see the hidden fields and submit them along with whatever other data they were sending. If the intention is to trick

Re: [PHP] Alternative/Addition to using a CAPTCHA

2007-03-30 Thread tg-php
hah.. I was going to let this discussion die a bit because a lot of it is fairly off-topic. But here and there we've hit on some PHP specific topics. I just had to say Kudos to tedd for providing a fairly interesting and possibly very functional CAPTCHA solution. True, a simple blue dot could

Re: [PHP] Re: Alternative/Addition to using a CAPTCHA

2007-03-30 Thread tg-php
Ah ok.. that makes a bit more sense. Even still.. anyone who's going out of their way to program a bot to defeat your specific CAPTCHA mechanism will probably notice the failure in testing. Unless you made a failure behave similar to a success but put them in a situation where ultimately they

Re: [PHP] mixture of GET and POST

2007-04-03 Thread tg-php
As mentioned, this isn't a PHP issue really, except a little bit on the receiving end. Why not use multiple 'submit' buttons instead of using HREF links? In PHP, you'd just check the value of $_POST['action'] You can also do it with image submit buttons, just have to change the name of eac

Re: [PHP] Idea/Suggestion for PHP App

2007-04-05 Thread tg-php
I think you're probably doing what almost all of us have done. Get an idea, see PHP as a potential solution and decided to just dive right in. I don't think many people start out in a classroom style "Hello World" situation and build slowly onto that. I'm sure other people have better starter

Re: [PHP] "Sense" last record

2007-04-09 Thread tg-php
Sorry, I only saw the one response to this question so not sure if what I'm going to propose was already mentioned and wouldn't work. Two things come to mind.. first, it looks like "blocoTextoLast" just has different margin settings, I assume because it's located on the right side of the page

Re: [PHP] Array remove function?

2007-04-10 Thread tg-php
Unset works, but if he's trying to do a search and remove in one function, unset is a step removed from that criteria (missing the 'search' part). Looking at the array functions, I see some potential. # array_remove(array(1=>2,2=>3),2,true); // array (2=>3) // Keep all but where values = 2 $new_

Re: [PHP] Novice PHP Question - Listing Folder Contents

2007-04-10 Thread tg-php
In addition to the suggestions made, check out opendir() too. It may be a little simpler for what you're doing. Not sure. Remember, the beauty of PHP is that there's almost always a fuction or two already made that do what you want. Even some semi-obscure stuff. So always scan through the f

[PHP] OT Apologies.. Re: [PHP] Firefox and Crafting Tables

2007-04-10 Thread tg-php
Just glad this wasn't my grociey list or something worse. hah.. sent to the wrong address, my apologies. But for anyone looking for some good tradeskill craft recipe lists for World of Warcraft or for ways to help their Firefox be a little nicer on memory usage, there ya go. *shame* -TG = =

Re: [PHP] mysql if empty

2007-04-10 Thread tg-php
Turn on MAGIC QUOTES and REGISTER GLOBALS Once you've done that, install Postgres. Run your MySQL command again, Postgres has much better error reporting and will assist in debugging the situation. You might consider replacing your javascript functions with PHP ones since JS can sometimes int

Re: [PHP] mysql if empty

2007-04-10 Thread tg-php
Top-posting is sublime. Embrace it. Why scroll through 10 pages of emails you've already read when you can get to the meat of it all in the first few lines of an email? :) Plus trying to quickly separate all the previous replies from the latest one when some emailers indent, indent with lead

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread tg-php
Couple of questions come to mind... 1. How big is this template that you're loading? Not sure why almost any HTML file would take up 300+ meg of memory when loaded into a variable. Are you loading images and other content in as well or just the HTML file? 2. Replacing the placeholders with act

Re: [PHP] Download multiple sound files?

2007-04-12 Thread tg-php
Stut beat me to it... downloading multiple files at once is probably best done with compressing them and just downloading the one file. You could possibly rig a situation where the user downloaded one file, then a certain number of seconds later, the page redirects to the next file to download

Re: [PHP] Download multiple sound files?

2007-04-12 Thread tg-php
Does this mean we need to start lobbying against connectionless protocols like HTTP so we can better download multiple files? hah And POP3 probably existed long before the old BBS', so it's not that things got LESS efficient, it's just that we didn't NEED to bundle bunches of emails together in

Re: [PHP] CSS vs. Tables OT OT OT OT OT OT OT OT OT OT

2007-04-18 Thread tg-php
Mom! Dad! Please don't fight! = = = Original message = = = On Tue, 2007-04-17 at 22:04 -0500, Larry Garfield wrote: > On Tuesday 17 April 2007 9:54 pm, Robert Cummings wrote: > > > > You say "Using tables for layout *is* a hack". Unfortunately for you > > tables were intended for laying out

RE: [PHP] PHP excel capability

2007-04-18 Thread tg-php
Or, even better and more useful: http://pear.php.net/package/Spreadsheet_Excel_Writer It's not perfect, but it does the basic job. Also, if you output an HTML table and set the content type in your header to an Excel content type, it should ask the client PC to open the page in Excel (assuming

[PHP] ENOUGH!! RE: AW: [PHP] Student Suspended Over PHP use.

2005-02-10 Thread tg-php
This thread, as relates to PHP, is pointless. If people have issues with what someone else said, please take it up with them privately and/or notify the list admins if you think it was inappropriate enough to warrant administrative action. The joke was cute but all in all, not that funny. It

Re: [PHP] Uploading products in database using zip file?

2005-02-14 Thread tg-php
That should be true in general except I believe that WinZip 8(?) introduced a new compression scheme that unzip or infozip or whatever on un*x systems might not handle yet. It's not backward compatible with older Zip algorithms so even if you're running and older copy of WinZip it won't decompr

Re: [PHP] Windows COM programming.

2005-02-21 Thread tg-php
I might be able to provide a little insight, but all my code that I've done COM work with is at home so I can't send you any samples right this second. I've used PHP and COM to interface with Excel, Outlook and MapPoint. I'm not terribly familiar with using Objects with PHP, but have done a ton

RE: [PHP] On Topic - Theoretical Concents of Anti-password trading/sharing solutions

2005-03-01 Thread tg-php
I agree with Mikey on the "live and let live" side of things. This forum is about sharing technical knowlege and helping other users overcome technical challenges relating to PHP. Yeah, a site that's "adult oriented" is most likely a pay site. Doesn't mean they make money, but assuming they m

Re: [PHP] line feed

2005-03-04 Thread tg-php
echo '' . chr(10); chr(10) should be line feed and chr(13) is a carriage return (aka "\r"). Unless I got those mixed up. But yes, you can do that. Or you could even cheat and do: echo '' . "\n"; -TG = = = Original message = = = Double quotes: echo "\n"; single quotes: echo ''; c

Re: [PHP] Database engine in PHP

2005-03-04 Thread tg-php
Did anyone recommend SQLite yet? It comes with PHP5 but I believe you can get an extension for PHP4 to do it as well. It's basically a super light-weight SQL based database system. Loads all the tables into memory if I remember right, but great for exactly what you're talking about (if I unde

[PHP] ezmlm "bounced email" warnings - [was RE: [PHP] suspicious - maybe spam]

2005-03-09 Thread tg-php
Yeah, same here. I thought it was my hosting service, but if other people are having the same issue then what's the deal? Usually it's only a message or two, but sometimes it says there are like 8 or 9 messages that bounced. Has anyone looked into this or have any information regarding this

Re: [PHP] Avoiding SQL injections: htmlentities() ?

2005-03-26 Thread tg-php
Actually I was just about to look into this again myself since I'm working on a project that I'd like to protect from SQL injections. htmlentities() is a start, but that's not going to protect you from someone using apostrophes (single quotes) and breaking your SQL in other ways. While some of

Re: [PHP] Avoiding SQL injections: htmlentities() ?

2005-03-26 Thread tg-php
Thanks a ton, Chris & Chris! Clear, concise and informative answers are always the best :) I knew the basic theory but never looked into the specifics on what, exactly, could be harmful in cases like this. In cases of security 'common sense' isn't always helpful because it's the uncommon sen

[PHP] phpDocumentor usage (specifically changelog capability?)

2005-03-28 Thread tg-php
I didn't see a specific mailing list for phpDocumentor and wanted to get a general feel for people's experiances with it. I see that Zend Studio 4 supports it internally and I'd really like to get our group over to a standardized documentation scheme (and in the process, make use of what looks

RE: [PHP] Best Server OS

2005-03-28 Thread tg-php
I will! Ok, not completely. I'm an avid windows user, but not a blind Gates disciple.. please don't accuse me of that. I will never say that a Windows server is the 'best' platform for doing PHP script serving because I don't believe that's the case. It DOES work, but it's far from the 'best

Re: [PHP] rawurldecode

2005-03-28 Thread tg-php
Could you use parse_url() and just take the [query] section of it, then maybe do an explode on "&" to get the different parts of it? -TG = = = Original message = = = I am trying to use the rawurldecode() function to decode a variable that is begin passed from a different page through the url.

Re: [PHP] Any personal experience with MySQL/Calendar application

2005-03-29 Thread tg-php
Made one myself that I thought was pretty good at the time (one of my first PHP projects) but as I learned more about PHP, I see that I did things the hard way, so it's in bad need of updating. If you wanted the source to play with as a starting point, I could probably through that together for

Re: [PHP] How to format every secound row in a database result

2005-03-30 Thread tg-php
I've used the mod (%) function to do this, which also gives you the flexibility of defining how many lines to alternate the colors or do whatever you need to do every "X" lines. Another method (and forgive me if this was mentioned, I didn't see it yet) is to use a bitwise NOT to flip-flop a val

Re: [PHP] Post shorter code

2005-04-21 Thread tg-php
All of them. :) -TG = = = Original message = = = > You're far more likely to get someone to look at your problem code if > you can narrow it down to a block of code. Hell, you didn't > even state a problem!!! > > Sorry, but if you come back with a well defined problem then maybe > someone can h

Re: [PHP] PEAR Packages

2005-04-21 Thread tg-php
I was a little confused at first, but it's actually REALLY simple. I was doing manual installations until I discovered that PEAR has made everything way too easy for us. >From the PEAR manual: ## To update your PEAR installation from go-pear.org, request http://go-pear.org/ in

Re: [PHP] PEAR Packages

2005-04-21 Thread tg-php
For us, the unix instructions worked 100% on Windows as well. Guess since it's all PHP based it didn't make a difference. Probably some minor internal tweaks and checks due to filesystem differences, but the PEAR guys did a great job in making it all very easy. Now for us lazy Windows guys, s

Re: [PHP] Re: reverse MD5 ???

2005-04-21 Thread tg-php
Nope.. nothing that'll easily decrypt MD5 back to it's original value. As the line below says and the rest of the thread explained, MD5 is a one-way function. In ordre to take an MD5 hash and get back to the original value, you'd basically have to take every possible combination of letters/num

Re: [PHP] MSSqlServer table/field information

2005-04-23 Thread tg-php
http://www.sqlzoo.net/howto/source/z.dir/i12meta.xml Check out the META DATA section of this page (link above). I used it to create a database 'walker' app that lets you search for table names, column names, etc. I was working on a HUGE database that wasn't documented well and nobody could gi

Re: [PHP] Editing PDF

2005-05-10 Thread tg-php
Also keep in mind that any graphics in the PDF, even an uncompressed one, will show up encoded... Base64 or UTF or whatever PDFs use. I also remember reading once that there's data at the end of the PDF that gives a pointer to where in the PDF certain data is. That if you add/remove stuff from

Re: [PHP] MySql injections....

2005-05-11 Thread tg-php
Don't forget your native database escaping function. PHP has this one for MySQL, for example: mysql_real_escape_string() That should properly escape everything that could be used against MySQL to perform an injection. There should be some equivalent commend in the various database connection

Re: [PHP] str_replace on words?

2005-05-11 Thread tg-php
As mentioned in the "making words bold" thread, works aren't always separated by spaces. Sometimes they end a sentence so are followed by a period or other punctuation. Sometimes you have strings like "and/or" where they're separated by the forward slash, etc. You really have to do some kind

Re: [PHP] marking words bold

2005-05-11 Thread tg-php
That's a good first step, but I think you're going to have to go with the regex for this one. What happens if one of the words he wants to highlight is near punctuation? > $t = str_replace(" $word ", " $word ", $text); This wouldn't work if you had: $text = "I'm going to the store."; $word =

Re: [PHP] Re: SQL Date guru in the house?

2005-05-11 Thread tg-php
Sorry, don't have time to look up the specifics.. and I've worked with a number of different flavors of SQL, so not sure the syntax or capabilities of the system you're using, but maybe try something like this: SELECT * FROM blah WHERE DATE(mm, dd, yyy) BETWEEN $date1 AND $date2 Basically conve

Re: [PHP] expand array into function arguments?

2005-05-11 Thread tg-php
There's probably some clever answer to this like "Just do myFunc($myList) and it'll automatically parse out the arguments".. because PHP does clever things like that sometimes. But if anything, you can do something like this: $myList = array(1, "arg", 5); myFunc($myList); function myFunc($arg

Re: [PHP] WINBINDER! WOOT! Re: PHP-GTK, or something else, for desktop app development?

2005-05-16 Thread tg-php
I missed the original post, but if you're looking at doing Windows desktop development and want a GREAT alternative to GTK, definitely check out Winbinder! Rubem and crew have done an awesome job (even though he modestly calls it an "alpha" release.. it's very function). It's a native Windows

Re: [PHP] Basic PHP/HTML code question

2005-05-18 Thread tg-php
Since PHP is server-side, it's probably not the best option for doing what you're describing. It IS possible to use a javascript "onchange" event and use that to trigger a new page load which would change your second select box, but that's kind of slow and sloppy and should probably only be use

RE: [PHP] PHP excel capability

2007-04-23 Thread tg-php
I had some issue when I tried CSV in the past. I don't know if there was some issue with use of commas in the data and not getting Excel to properly use "some data, with commas", "some more data" so that it'd omit the quotes as well or what. In the end, for the quick and dirty throwaway projec

Re: [PHP] move "if" logic from php into query

2007-04-27 Thread tg-php
In my data scrubbing function, I pass it a content type (phone, city, SSN, etc), do whatever scrubbing/filtering I'm going to do on that type of content, then after everything's done, then I do the mysql_real_escape_string() on it and return that to where the function was called. That way, ever

Re: [PHP] PHP sorting csv array output

2007-05-10 Thread tg-php
When you load your data into your array, you can use the timezone (or whatever field you're using to sort) as the array key, then use ksort(). Check the "see also" for a bunch of other types of sorting you can do. When it comes to the multisorts and user defined sorts, I'm at a bit of a loss..h

Re: [PHP] PHP debugger

2007-05-15 Thread tg-php
Don't know if it'll do what you want it to do...and if you're using Joomla, it might be tricky (or not... havn't messed with Joomla enough to know) to insert it into the system in a meaningful way.. but check out this: FirePHP: http://www.firephp.org/ Works with Firebug Firefox extension to giv

Re: [PHP] convert numerical day of week

2007-05-22 Thread tg-php
Mom! Dad! Stop fighting! = = = Original message = = = On 5/22/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > Yours is the least maintainable. Hehe.. with 4 times as many lines of code and 160% more bytes of code overall? > cat locale.php|grep -v ^$|wc -l 16 > cat simple.php|grep -v

Re: [PHP] IF with multiple values for a variable

2007-06-13 Thread tg-php
Could try something like this: $types = array('T', 'D', 'L'); if (in_array($type, $types)) { // do something } But that's going to just check to see if $type is one of the valid types you're looking for. You might try something like switch. switch ($type) { case 'T': // Output 'T' rec

Re: [PHP] IF with multiple values for a variable

2007-06-13 Thread tg-php
double pipes constitutes an "OR" operation. You can use the keyword OR as well. Also, && and AND are the same as well. http://us.php.net/manual/en/language.operators.logical.php -TG = = = Original message = = = Excellent! Double pipes to seperate possible multiple variable values. Thank

RE: [PHP] Date

2007-06-20 Thread tg-php
Don't forget that in cases like the one below, you can use the list() function to tighten things up a bit: $start_date='2007-06-20'; list($start_year, $start_month, $start_day) = explode('-',$start_date); I prefer using the date functions that some of the other people mentioned and only use t

[PHP] Small LAMP install/distro

2007-06-21 Thread tg-php
Ok, done all my googling and experimenting, now I'm tossing it to you guys. Can anyone recommend a small, no frills, LAMP-centric linux package/distro? What I'm doing is setting up a test/development environment in a VMWare virtual machine to keep things all nice and comparmentalized. It's goin

Re: [PHP] Small LAMP install/distro

2007-06-21 Thread tg-php
Yeah, I took a quick look at Damn Small Linux. And have been playing around with Puppy Linux (which is pretty cool too). I may end up using one of those. Wanted to see if there was a distro with everything built into it already (Damn Small seems to have a lot of average user apps and not rea

RE: [PHP] Small LAMP install/distro

2007-06-21 Thread tg-php
Yeah.. I'm aware. As I stated in my original email: "Ideally I'd like to keep using my traditional Windows apps to do development..." I'm comfortable moving around in linux, but the tools and OS I choose to use are all Windows-centric. But instead of installing Apache and PHP and MySQL on m

Re: [PHP] Small LAMP install/distro

2007-06-22 Thread tg-php
First, funny that you say that from a Gmail account, where top-posting is encouraged by the mail system. Second, and not to get into a big discussion about top vs bottom posting, but I top-post because typically if I'm involved in a conversation, I know what's been said already and don't want t

Re: [PHP] Small LAMP install/distro

2007-06-22 Thread tg-php
Excellent information Jim! Thanks a ton! I really wish I knew linux more intimately so I knew what was a vital organ and what was an appendix :) Your suggestions sound like exactly what I'm looking for. Greatly appreciated! Actually.. one question. Won't it try to set up a swap partition?

RE: [PHP] Small LAMP install/distro

2007-06-22 Thread tg-php
Thanks for the suggestions.. but again, the question wasn't "what distro of linux" to use. And I don't mind upgrading things. The question is what would someone recommend for a really small distro of linux preferably with the bare essentials + apache, mysql, php and samba. Failing that, I'll

Re: [PHP] Small LAMP install/distro

2007-06-22 Thread tg-php
Thanks again for the info, Jim. will look into the 'install to flash drive' information. Technically that's not what I'm doing, just want to store the virtual machine on the flash drive, but the installation instructions should be tight enough to be pertinent still. I think you got close eno

Re: [PHP] Small LAMP install/distro

2007-06-22 Thread tg-php
"logic" is subjective. When I read "Because it breaks the logical sequence of discussion.", I already knew what you were talking about without having to read the question.. because I knew what was being discussed in this thread. If it wasn't an answer to my original question, then it was about

Re: [PHP] Re: what trick is this? How to do it?

2007-07-13 Thread tg-php
View the source and trace through the javascript. Looks like it has to do with: function openLogin() Which calls: dojo.require("dojo.widget.Dialog"); and.. floatingWindow = dojo.widget.createWidget("Dialog", properties, node); and.. floatingWindow.setContent(""); Don't have time right now

Re: [PHP] Reading registry values

2007-07-30 Thread tg-php
I'm not sure that there's actually anything you'd need to access in the server registry (and certainly no registry in Linux if you're also transitioning from Windows to Linux). And depending on what the ActiveX control your ASP pages accessed actually does, it may be better to recreate it in P

Re: Re[2]: [PHP] Reading registry values

2007-07-30 Thread tg-php
Yeah, that could be one thing that the ASP/ActiveX combo need to access the registry for.. but if he's replacing ASP with PHP and if the ActiveX control doesn't do anything he can't re-create in PHP, then there's no need to verify that anything relating to ASP or ActiveX is registered and genui

Re: [PHP] Loss of precision in intval()

2007-08-01 Thread tg-php
Very weird and counter intuitive. Looking at the php manual, I see this: Converting to integer from floating point: "When converting from float to integer, the number will be rounded towards zero." But you'd think the multiplication would happen before the rounding. if you do: $a = ceil(75.82

  1   2   3   4   >