[PHP] The Data Literacy Test: Interpretation Added
Fyi, The interpretation of the score is added. Welcome to check your programming knowledge level: http://www.phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test :) -- With best regards, Shelley Shyan http://phparch.cn
Re: [PHP] Re: PHP on 64bit Ubuntu
The opposite might be true of user code though as developers become presumptive of the compiler doing their work for them :) Like PHP... which does absolutely no optimizations. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP on 64bit Ubuntu
On Thu, 2008-09-25 at 23:17 -0700, steve wrote: The opposite might be true of user code though as developers become presumptive of the compiler doing their work for them :) Like PHP... which does absolutely no optimizations. You must not be using an optimizer. It may not be PHP specifically performing the optimization, but that's the beauty of PHP and how it allows extensions to hook into the engine at such a low level. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The Data Literacy Test: Interpretation Added
On Fri, 2008-09-26 at 14:02 +0800, Shelley wrote: Fyi, The interpretation of the score is added. Welcome to check your programming knowledge level: http://www.phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test :) From the interpretation: 20–24 You are an expert programmer. You probably already have the books listed below on your shelf. *lol* Why would probably be applicable in this scenario? More likely most people hit up google to answer their questions. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] calling functions from one or multiple files
On Thu, 2008-09-25 at 23:02 -0400, Robert Cummings wrote: On Fri, 2008-09-26 at 02:10 +0200, Jochem Maas wrote: Ashley Sheridan schreef: On Fri, 2008-09-26 at 01:05 +0200, Jochem Maas wrote: tedd schreef: At 3:44 PM -0400 9/24/08, Robert Cummings wrote: Seems kind of silly to have every function in it's own file. Also seems kind of cluttered ot have every function in one file. Now grouping related functions into a single file... that's sounds like a good middle ground. Cheers, Rob. The Goldie Locks solution. otherwise known as mediorce ... rather like his blowup doll :-P Cheers, tedd Why does it always come back to that poor doll?! dunno, but it's rather apt to say 'screw the doll' :-P Hmm. I tried: apt-get screw the doll E: Invalid operation screw What am I doing wrong? Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP This happens if you use the wrong parameters. Use a LONG instead of a SHORT ;) Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The Data Literacy Test
2008/9/24 Shelley [EMAIL PROTECTED] http://phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test The Data Literacy Test: http://www.phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test -- With best regards, Shelley Shyan http://www.phparch.cn WTF! Don't you think a PHP site would allow the user to input their score and tell them their level on the next page?
Re: [PHP] Filters and sanitizing a regexp
Hi, I don't think that one is quite right... Your optionals (?) are confusing. Why [0-3]?[0-9] AND the \d? No reason. Why [0-9] at all (since \d is essentially [0-9])? Again, no reason. Why use the discarded capture group (?:) since the [0-3] is already optional? It makes it look more like gibberish? -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Don't understand what is this $arr['N']['#']
Please don't top post any more. thank you. Because it's such a cardinal sin and will result in you being sent straight to hell. I've heard that it's not so nice there at this time of year, though the heat is more bearable. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The Data Literacy Test
Tom Chubb wrote: 2008/9/24 Shelley [EMAIL PROTECTED] http://phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test The Data Literacy Test: http://www.phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test -- With best regards, Shelley Shyan http://www.phparch.cn WTF! Don't you think a PHP site would allow the user to input their score and tell them their level on the next page? wondered when somebody would say that; my thoughts exactly - would also make more sense to be multiple choice seeing as many choose to cheat themselves as it were -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Don't understand what is this $arr['N']['#']
well said :) Richard Heyes wrote: Please don't top post any more. thank you. Because it's such a cardinal sin and will result in you being sent straight to hell. I've heard that it's not so nice there at this time of year, though the heat is more bearable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filters and sanitizing a regexp
Richard Heyes wrote: Hi, I don't think that one is quite right... Your optionals (?) are confusing. Why [0-3]?[0-9] AND the \d? No reason. Why [0-9] at all (since \d is essentially [0-9])? Again, no reason. Why use the discarded capture group (?:) since the [0-3] is already optional? It makes it look more like gibberish? hate to say this but why not cater for all eventualities and just use strtotime( $whatever ); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Unicode problems
Thiago H. Pojda wrote: This is slightly OT but I honestly don't know what else I can do. I was asked to migrate a website from diff hosts. Okay, pretty easy, right? Well, as usual, it wasn't. Site pages content type was ISO-8559-1 and it was developed for a MySQL5 database that used latin1 as charset and InnoDB as storage system. Pretty normal and ran smoothly. The client database is a old 4.0 MySQL that (I'm not sure if they're just disabled but it) doesn't have InnoDB and latin1. So I'm stuck with MyISAM and UTF8. No, they can't change it - their hosting want them to migrate to MSSQL and they can't switch hosts for whatever reason. After I uploaded the files and ran it, my HTML files displayed correctly but all accented chars that came from DB were displayed with weird chars, as I imagined it would. I then set my html content type to UTF-8 and I also had problems, but in backwards this time - DB values were OK and website content was bad. I couldn't find any good function/script to convert all my files to UTF-8 and then I built my own. It uses iconv and works like a charm. But unfortunately I still can't get all pages to work. I have no idea why or how, but *some* queries return the text in ISO-8859-1. I even dropped the table and recreated them explictly saying it's a UTF8 table but some rows are in ISO and others in UTF-8 (that or some mysql_fetch_* functions converts them). It's been 2 days and I still can't see a solution. I even thougth of adding utf_decode on all of mysql_fetch* results, but I didn't build this website so I don't feel like adding that in *every* call (it doesn't have a wrapper for mysql_* functions). So, I'm here to humbly ask for your help. What can be wrong? PHP Version is 4.4.8 Thanks, you could simply dump the database via the command line, utf8_encode the generated sql file, then drop it back in (?) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filters and sanitizing a regexp
hate to say this but why not cater for all eventualities and just use strtotime( $whatever ); Well it just doesn't have enough geek factor... -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing Variables to an iframe
This may be more a general HTML question, so let me know if I should post somewhere else. I was hoping to do some logic in a script, and then pass the results of that script to an iframe for more processing. Is it secure to include those variables as get parameters to the iframe, though? In other words, if I have something like this: iframe src=http://example.com/?accesseverything=true; where I use PHP to generate the src for the iframe. Could someone just use Firebug or something to set that variable? Is there a better way of passing it instead? Thanks, Waynn
Re: [PHP] Filters and sanitizing a regexp
Well it just doesn't have enough geek factor... So true it hurts Mr Heyes Lol. and very nice work on the RGraph! just noticed it in your tag - having a good read now :) Thanks. Sad that IE8 won't (I think) support the canvas tag. Though Chrome, Firefox, Safari and Opera do and it's in the HTML5 draft, so it will eventually. IE 9 maybe. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filters and sanitizing a regexp
On Sep 26, 2008, at 7:23 AM, Richard Heyes wrote: Well it just doesn't have enough geek factor... So true it hurts Mr Heyes Lol. and very nice work on the RGraph! just noticed it in your tag - having a good read now :) Thanks. Sad that IE8 won't (I think) support the canvas tag. Though Chrome, Firefox, Safari and Opera do and it's in the HTML5 draft, so it will eventually. IE 9 maybe. Yeah, it might make it into IE 9 but you know when Microsoft first introduces it it will draw the graphs upside down and backwards... And then we will have to come up with a hack to get it to flip it back the way it should adding lots of bloat to our nice and tidy pages :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 11287 James St Holland, MI 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The Data Literacy Test: Interpretation Added
At 2:02 PM +0800 9/26/08, Shelley wrote: Fyi, The interpretation of the score is added. Welcome to check your programming knowledge level: http://www.phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test :) The answer as I see it is 27. While we both agree that elongated stream, retroactive synapse, and value chain are false computer terms, there are three that you apparently don't know. Would you care point those out so we can discuss them? This reminds me of a survey I conducted in the late 80's where I had section of computer terms for people to indicate what was familiar, or not. The answer of each was either I heard of it, I know it, or Huh? I used that answer to test the truth of the person taking the survey. Interesting enough, I found the ratio of truth was equally spread between all age groups. In other words, the 20-30, 31-40, 41-50, 51-60 age groups all had the same ratio of people reporting a false term as I know it. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Convert local dates into GMT+1 dates
Hello everyone! I have local dates (Belgium), which I want to convert to GMT+1 date. The dates are stored in the DB and are of the following format: '2008-06-24 23:30:02' So I think I'll need to check wether the date in DB is GMT+1 or GMT+2 (winter or summer), if date is GMT+2, subtract one hour from the date. Thank you for any help achieving this !! -- View this message in context: http://www.nabble.com/Convert-local-dates-into-GMT%2B1-dates-tp19687861p19687861.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Convert local dates into GMT+1 dates
On Fri, Sep 26, 2008 at 8:52 AM, debussy007 [EMAIL PROTECTED] wrote: Hello everyone! I have local dates (Belgium), which I want to convert to GMT+1 date. The dates are stored in the DB and are of the following format: '2008-06-24 23:30:02' So I think I'll need to check wether the date in DB is GMT+1 or GMT+2 (winter or summer), if date is GMT+2, subtract one hour from the date. Thank you for any help achieving this !! -- View this message in context: http://www.nabble.com/Convert-local-dates-into-GMT%2B1-dates-tp19687861p19687861.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php mktime()? -- Bastien Cat, the other other white meat
Re: [PHP] Convert local dates into GMT+1 dates
debussy007 wrote: Hello everyone! I have local dates (Belgium), which I want to convert to GMT+1 date. The dates are stored in the DB and are of the following format: '2008-06-24 23:30:02' So I think I'll need to check wether the date in DB is GMT+1 or GMT+2 (winter or summer), if date is GMT+2, subtract one hour from the date. Thank you for any help achieving this !! Surely this shouldn't be an issue and that's what timezones are for? if your timezone is set up correctly on server then DST will be auto handled for you? get the date as UTC, always store as UTC, then present as whatever timezone you want; thus your time is always accurate regardless of DST. (I hardly understood what I just wrote, but I know what I mean). Regards! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Variables to an iframe
On Fri, Sep 26, 2008 at 7:17 AM, Waynn Lue [EMAIL PROTECTED] wrote: This may be more a general HTML question, so let me know if I should post somewhere else. I was hoping to do some logic in a script, and then pass the results of that script to an iframe for more processing. Is it secure to include those variables as get parameters to the iframe, though? In other words, if I have something like this: iframe src=http://example.com/?accesseverything=true; where I use PHP to generate the src for the iframe. Could someone just use Firebug or something to set that variable? Is there a better way of passing it instead? Thanks, Waynn sessions? -- Bastien Cat, the other other white meat
Re: [PHP] Convert local dates into GMT+1 dates
On Fri, Sep 26, 2008 at 8:52 AM, debussy007 [EMAIL PROTECTED] wrote: Hello everyone! I have local dates (Belgium), which I want to convert to GMT+1 date. The dates are stored in the DB and are of the following format: '2008-06-24 23:30:02' So I think I'll need to check wether the date in DB is GMT+1 or GMT+2 (winter or summer), if date is GMT+2, subtract one hour from the date. Thank you for any help achieving this !! -- View this message in context: http://www.nabble.com/Convert-local-dates-into-GMT%2B1-dates-tp19687861p19687861.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Perhaps this will help: http://us3.php.net/manual/en/function.timezone-offset-get.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The Data Literacy Test
On Sep 24, 2008, at 8:22 PM, Shelley wrote: 2008/9/25 Philip Thompson [EMAIL PROTECTED] On Sep 24, 2008, at 7:29 AM, Maciek Sokolewicz wrote: tedd wrote: At 12:25 PM +0100 9/24/08, Ashley Sheridan wrote: On Wed, 2008-09-24 at 09:20 +0800, Shelley wrote: http://phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test The Data Literacy Test: http://www.phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test What the smeg is this? I don't know, but I figure 27. Cheers, tedd yes, I think 27 aswell... - Tul No no no. We all know the answer is 42. ? How come 42? Just in case it's not clear what the others have commented about 42... http://wikipedia.org/wiki/Answer_to_Life,_the_Universe,_and_Everything ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing Variables to an iframe
-Original Message- From: Waynn Lue [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2008 6:17 AM To: PHP General list Subject: [PHP] Passing Variables to an iframe This may be more a general HTML question, so let me know if I should post somewhere else. I was hoping to do some logic in a script, and then pass the results of that script to an iframe for more processing. Is it secure to include those variables as get parameters to the iframe, though? In other words, if I have something like this: iframe src=http://example.com/?accesseverything=true; where I use PHP to generate the src for the iframe. Could someone just use Firebug or something to set that variable? Is there a better way of passing it instead? I'm still not fully awake yet, so I won't comment as to a better way, but I'll say this: any properties of any DOM element you dish out to the user can be read and/or modified after they have been sent. If you have any filenames, URLs, or sensitive data that is used in processing--but *doesn't* need to be seen by the user or the client machine at any time--don't output it. :) Todd Boyd Web Programmer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The Data Literacy Test
yeah, already saw that. 2008/9/26 Philip Thompson [EMAIL PROTECTED] On Sep 24, 2008, at 8:22 PM, Shelley wrote: 2008/9/25 Philip Thompson [EMAIL PROTECTED] On Sep 24, 2008, at 7:29 AM, Maciek Sokolewicz wrote: tedd wrote: At 12:25 PM +0100 9/24/08, Ashley Sheridan wrote: On Wed, 2008-09-24 at 09:20 +0800, Shelley wrote: http://phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test The Data Literacy Test: http://www.phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test What the smeg is this? I don't know, but I figure 27. Cheers, tedd yes, I think 27 aswell... - Tul No no no. We all know the answer is 42. ? How come 42? Just in case it's not clear what the others have commented about 42... http://wikipedia.org/wiki/Answer_to_Life,_the_Universe,_and_Everything ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- With best regards, Shelley Shyan http://phparch.cn
[PHP] Re: Passing Variables to an iframe
Waynn Lue wrote: I was hoping to do some logic in a script, and then pass the results of that script to an iframe for more processing. why pass the results back to the client when your not finished processing them? simply include the next script and only pass user the *final* results (?) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Unicode problems
Hello, On Fri, Sep 26, 2008 at 9:07 AM, Daniel Jaeger wrote: I had similar problems, I cant get the whole situation out of what you wrote but here are two hints. If you got SSH Access you can try to import the DB by following command I don't have SSH access :/ Otherwise if you can't access the server on this way you can set the whole DB connection on the PHP application to the wanted charset by using following function mysql_set_charset - but as this one just works on PHP 5.2.3 you can do the same (not recommendet way) over the Set names MysqlQuery - this Query just needs to be run after the connection has been established (mysql_connect()). Tried without success. Just have a look at the doc of the mysql_set_charset function there you see on the third comment a implementation of this function for all who have an earlier PHP Version than 5.2.3 ( http://de3.php.net/manual/de/function.mysql-set-charset.php) Hope I could help. Actually all the responses did help. While I was researching I figured some weird stuff. I tried MySQL 4.0 examples for CAST() and CONVERT() and all I got were syntax errors. This DB is broke. Cheers Daniel I did the following: 1) Extract the DB script from the working one; 2) Manually added CHARSET=utf8 for each create table; 3) Converted this script to UTF8 and opened with a ANSI reader and all the accented chars got funny. Great! That's what I wanted. 4) Applied the script into the database and more frustration. *Some* lines were in utf8 and some in latin1. I can only imagine the hosting is forcing this kind of behaviour so the client has to switch DBMS. (I don't see how, but well). I'm still trying and researching. If anyone else have any idea, please reply. Thanks everyone! -- Thiago Henrique Pojda
[PHP] JSON in PHP5?
I thought that the json extensions where in =PHP5.2. Here's my example file and the output. What's up? Do I need to install something else. file: ?php echo PHP version: , phpversion(), br/; if (function_exists('json_encode')) echo json_encode() exists; else echo json_encode() doesn't exist; ? output: PHP version: 5.2.5 json_encode() doesn't exist
Re: [PHP] JSON in PHP5?
On Fri, Sep 26, 2008 at 8:50 AM, Dan Zilavy [EMAIL PROTECTED] wrote: I thought that the json extensions where in =PHP5.2. Here's my example file and the output. What's up? Do I need to install something else. file: ?php echo PHP version: , phpversion(), br/; if (function_exists('json_encode')) echo json_encode() exists; else echo json_encode() doesn't exist; ? output: PHP version: 5.2.5 json_encode() doesn't exist did you configure w/ --disable-json ? -nathan
[PHP] Re: Google Checkout
Am 2008-09-24 10:59:18, schrieb Richard Heyes: Hi, As a follow up, I've just switched from Paypal to Google Checkout. Setup was quick and pain free (easily less than 2 hours), and I would recommend it (so far). Like other people have said though, it's just UK and USA at the moment. Googly Checkout can not be use in over 80 countries... (Three of then are used by my with PayPal) There is not a singel advantage @Google except your finacial outing Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 +49/177/935194750, rue de Soultz MSN LinuxMichi +33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
[PHP] Re: Re: Problem with sorting
Am 2008-09-21 14:34:18, schrieb Eric Butera: Cute, get gmail and you won't have such problems. I can not use gmail by law... I am mot willing to share my self informations with the NSA/CIA or any other US American Organizations, lso I am spamed masively by gmail and googlemail and will never support this crap! if it's from a database could you order by substring(columnname, 2,1) or similar..? I've done stuff like this before but it is way too slow to be used on anything other than a manager screen (that isn't used much). I'd recommend creating another column that sets your data up correctly for sorting based on your criteria. Split the name of a microchip? I have tried this but it does not work as expected... Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 +49/177/935194750, rue de Soultz MSN LinuxMichi +33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
[PHP] Re: Re: Problem with sorting
Am 2008-09-21 15:21:51, schrieb Eric Butera: I could also always bcc replies to you so you get three. How great would that be? :D I could setup a botnet and subscribe you to 100.000 usenet groups... Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 +49/177/935194750, rue de Soultz MSN LinuxMichi +33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
Re: [PHP] Re: Google Checkout
On Thu, Sep 25, 2008 at 3:25 PM, Michelle Konzack [EMAIL PROTECTED] wrote: There is not a singel advantage @Google except your finacial outing and the fact that it appears that PayPal is now selectively choosing to up their prices and charge variable amounts per transaction. I had noticed it before, but going through and auditing my corporate balances this morning, I found out that PayPal is charging 3.9% + $0.30 on some transactions --- higher than their maximum advertised fee of 2.9% + $0.30. I've been a PayPal customer since X.com - about nine years. And I have to admit, even though it's still my preferred payment method, eBay buying it out years ago screwed everything to high hell. On the flip-side, I received a $2,000 payment that only incurred a $5 fee, so I guess I can't complain too loudly but I still will. Just a heads-up you may want to look over your transactions and calculate your fees over the last ten days or so. -- /Daniel P. Brown More full-root dedicated server packages: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] JSON in PHP5?
On Fri, Sep 26, 2008 at 9:19 AM, Nathan Nobbe [EMAIL PROTECTED]wrote: did you configure w/ --disable-json ? heres a way to run a quick test from the command line, php -i | grep json if that doesnt say 'enabled' on one of the lines youll have to recompile php and not provide --disable-json to configure. -nathan ps. sorry for additional noise
Re: [PHP] Re: Re: Problem with sorting
On Thu, Sep 25, 2008 at 3:12 PM, Michelle Konzack [EMAIL PROTECTED] wrote: Am 2008-09-21 15:21:51, schrieb Eric Butera: I could also always bcc replies to you so you get three. How great would that be? :D I could setup a botnet and subscribe you to 100.000 usenet groups... Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 +49/177/935194750, rue de Soultz MSN LinuxMichi +33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com) You know, you could just set up a mail rule that says if mail is from php-general and you're cc'd, just delete your cc copy. Then you wouldn't have to write instructions on a public list on how to interact with you. *shrug* As for the bcc thing, I was talking to Ashley. Please don't flatter yourself thinking it's all about you. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Unicode problems
On Fri, 26 Sep 2008 10:39:33 +0100, Nathan Rixham wrote: [...] I couldn't find any good function/script to convert all my files to UTF-8 and then I built my own. It uses iconv and works like a charm. But unfortunately I still can't get all pages to work. I have no idea why or how, but *some* queries return the text in ISO-8859-1. I even dropped the table and recreated them explictly saying it's a UTF8 table but some rows are in ISO and others in UTF-8 (that or some mysql_fetch_* functions converts them). Can you confirm: are you telling your PHP connection into MySQL to use Unicode? e.g. tell MySQL directly by executing the following statement: set names 'utf8' Also, is some of your data going through htmlentities() and coming out wrong? If so, look at specifying the character set: htmlentities($someText, ENT_COMPAT, 'utf-8'); -- Ross McKay, Toronto, NSW Australia Let the laddie play wi the knife - he'll learn - The Wee Book of Calvin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Filters and sanitizing a regexp
-Original Message- hate to say this but why not cater for all eventualities and just use strtotime( $whatever ); Well it just doesn't have enough geek factor... Plus, strtotime() does non-intuitive things with some inputs... I'd insist on at least some kind of confirmation page if you use that beast. ___ The information in this email or in any file attached hereto is intended only for the personal and confiden- tial use of the individual or entity to which it is addressed and may contain information that is propri- etary and confidential. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communica- tion is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product. Email trans- mission cannot be guaranteed to be secure or error- free. P6070214 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filters and sanitizing a regexp
On Fri, Sep 26, 2008 at 12:03 PM, Richard Lynch [EMAIL PROTECTED] wrote: -Original Message- hate to say this but why not cater for all eventualities and just use strtotime( $whatever ); Well it just doesn't have enough geek factor... Plus, strtotime() does non-intuitive things with some inputs... I'd insist on at least some kind of confirmation page if you use that beast. In the sites I write I have a lot of success with strtotime as long as I have a - to / converter. I also put a note of (Format date as MM/DD/). Funny that people still seem to want to type -'s. We're all creatures of habit, right? There is always a way to edit stuff though so it isn't the end of the world if it goes weird. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filters and sanitizing a regexp
Eric Butera wrote: On Fri, Sep 26, 2008 at 12:03 PM, Richard Lynch [EMAIL PROTECTED] wrote: -Original Message- hate to say this but why not cater for all eventualities and just use strtotime( $whatever ); Well it just doesn't have enough geek factor... Plus, strtotime() does non-intuitive things with some inputs... I'd insist on at least some kind of confirmation page if you use that beast. In the sites I write I have a lot of success with strtotime as long as I have a - to / converter. I also put a note of (Format date as MM/DD/). Funny that people still seem to want to type -'s. We're all creatures of habit, right? There is always a way to edit stuff though so it isn't the end of the world if it goes weird. you know you could just change the input to a date selector / calender / 3 text boxes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filters and sanitizing a regexp
On Fri, Sep 26, 2008 at 12:23 PM, Nathan Rixham [EMAIL PROTECTED] wrote: Eric Butera wrote: On Fri, Sep 26, 2008 at 12:03 PM, Richard Lynch [EMAIL PROTECTED] wrote: -Original Message- hate to say this but why not cater for all eventualities and just use strtotime( $whatever ); Well it just doesn't have enough geek factor... Plus, strtotime() does non-intuitive things with some inputs... I'd insist on at least some kind of confirmation page if you use that beast. In the sites I write I have a lot of success with strtotime as long as I have a - to / converter. I also put a note of (Format date as MM/DD/). Funny that people still seem to want to type -'s. We're all creatures of habit, right? There is always a way to edit stuff though so it isn't the end of the world if it goes weird. you know you could just change the input to a date selector / calender / 3 text boxes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Yep. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Google Checkout
Googly Checkout can not be use in over 80 countries... Googly? Sure sounds cuter... But regardless, it can be used in two, and I'm in one of them. There is not a singel advantage @Google except your finacial outing Financial outing? Do you mean their commission? 89 pence compared with over £2 (per transaction) is quite a difference, particularly if you making lots of sales. That's a pretty huge benefit IMO. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Google Checkout
On Fri, Sep 26, 2008 at 12:38 PM, Richard Heyes [EMAIL PROTECTED] wrote: Googly Checkout can not be use in over 80 countries... Googly? Sure sounds cuter... But regardless, it can be used in two, and I'm in one of them. There is not a singel advantage @Google except your finacial outing Financial outing? Do you mean their commission? 89 pence compared with over £2 (per transaction) is quite a difference, particularly if you making lots of sales. That's a pretty huge benefit IMO. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php There is also the side that no one has mentioned... Offering all payment methods that would appeal to your customers. PayPal or Google Checkout being better is really a relative statement. If you have demands from your customer base to take their payment via one or the other, you should probably just offer them both. Neither have a per month minimum, and there is no obligation to keep it, so why not offer them both? -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life.
Re: [PHP] Re: Google Checkout
On Fri, Sep 26, 2008 at 12:47 PM, Dan Joseph [EMAIL PROTECTED] wrote: There is also the side that no one has mentioned... Offering all payment methods that would appeal to your customers. PayPal or Google Checkout being better is really a relative statement. If you have demands from your customer base to take their payment via one or the other, you should probably just offer them both. Neither have a per month minimum, and there is no obligation to keep it, so why not offer them both? Just like that Dan Brown guy does. Man, he's REALLY something! Yes, that's correct, Other Dan, that is something I do. Also, in the spirit of this list and its OT stuff, here's something else to throw into the mix that I came across a week or two ago. I bookmarked it to check into later, and haven't had the chance, so let me know if it's a too good to be true, but is kind of thing or a click 3,000 AdSense ads every day and get this free scam. http://www.freeauthnet.com/ -- /Daniel P. Brown More full-root dedicated server packages: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sepating MySQL result set into html tables
Hello everybody, I have a mysql result set that I want to print out in an html table. But some times it gets so big that I will probably need to separate it in to multiple ones. I wrote a function that separates the result set into three ones like this: function showTable($columnNames,$data,$alignment,$wrap) { $limit = round(count($data)/3,0); $align = array('l'='align=left','c'='align=center','r'='align=right'); $table = table class='inner'; $table .= tabletrtdtable class='inner'; $table .= tr; foreach ($columnNames as $col_name){ $table .= th.$col_name./th; } $table .= /tr\n; foreach ($data as $j = $row) { if(($j % 2) == 0){ $table .= tr class=even; } else { $table .= tr class=odd; } for($i=0;$icount($row);$i++){ $table .= td .$wrap. .$align[$alignment[$i]]..$row[$i]./td; } $table .= /tr\n; if (($j == $limit-1) || ($j == (2*$limit)-1)) { $table .= /table/tdtdtable; $table .= tr; foreach ($columnNames as $col_name){ $table .= th.$col_name./th; } $table .= /tr\n; } } $table .= '/table/td/tr'; $table .= /table\n; print $table; } But I really need to tell the function in how many tables I need the result set to be separated. How can I do this? What can I put instead of this for 3 tables: (($j == $limit-1) || ($j == (2*$limit)-1)) I can't find the algorithm although I think I have done this before but I can't remember how. -- Thodoris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Unicode problems - solve
Sorry to bother you all, I just did the whole process again using only phpmyadmin and notepad++ (yes, I'm under windows) I could import the database successfully. The whole thing was converted to UTF8. @Richard: I'm using both, META and header. I didn't know IE6 had issues with header(), learning somehing new every day :) About UTF8, if you have text in ISO (latin1) and tell the browser it's a UTF8 it doesn't work 100%. Not the accented chars. Thanks for all the help, -- Thiago Henrique Pojda
Re: [PHP] Sepating MySQL result set into html tables
Thodoris wrote: Hello everybody, I have a mysql result set that I want to print out in an html table. But some times it gets so big that I will probably need to separate it in to multiple ones. I wrote a function that separates the result set into three ones like this: ... But I really need to tell the function in how many tables I need the result set to be separated. How can I do this? What can I put instead of this for 3 tables: (($j == $limit-1) || ($j == (2*$limit)-1)) I can't find the algorithm although I think I have done this before but I can't remember how. Why not just use LIMIT in your query and make several? Why do you need to split the data into multiple tables, anyway? $table = table class='inner'; $table .= tabletrtdtable class='inner'; That's going to give you badly-formatted HTML. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Google Checkout
On Fri, Sep 26, 2008 at 12:54 PM, Daniel Brown [EMAIL PROTECTED] wrote: Yes, that's correct, Other Dan, that is something I do. Same here. I have Visa/MC, Discover, Amex, PayPal, and Google Checkout. I'll add Revolution Money Exchange when the demand tools are there. Also, in the spirit of this list and its OT stuff, here's something else to throw into the mix that I came across a week or two ago. I bookmarked it to check into later, and haven't had the chance, so let me know if it's a too good to be true, but is kind of thing or a click 3,000 AdSense ads every day and get this free scam. http://www.freeauthnet.com/ -- /Daniel P. Brown More full-root dedicated server packages: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. This speaks volumes -- That's right, YOU PAY NOTHING for the Authorize.net license. Funny thing, I didn't realize that there was a license, and if there is, no one else charges for it either. There may be some eCommerce licensing fees that some eCommerce providers offer when they bundle everything, that's probably what they're competing against. Probably just a marketing ploy. Their trans fee and per trans rate are average. 24 cents can be high or low depending on what type of business you have, who you go through, etc. I wouldn't pay $8.95 for a statement fee, other people do those free. The gateway fee is $15.95, I think you can get that for $9.95 most other places. I myself don't use Authorize.net. I use the USA ePay gateway thru BCS worldwide. Its comparable, and really, with rates, this all depends on how high risk your business model is, and your personal credit score and history. I see this as nothing more than a slightly unethical marketing ploy. -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life.
Re: [PHP] How to show ppt file on webpage/flash
On Wed, Sep 24, 2008 at 6:20 PM, Ashley Sheridan [EMAIL PROTECTED]wrote: On Wed, 2008-09-24 at 16:59 -0400, James wrote: On Wed, September 24, 2008 2:53 pm, Tiji varghese wrote: Hi all, I want to show '.ppt' (Power Point) files on my web page either as a flash or embedded into web page or by doing some processing at the server side. The actual scenario being that a user would just upload their 'ppt' files online and on the next page I will be showing them the contents of the ppt file as a slide show, also making sure that user's formatting is well preserved.I don't mind what format it would be in as far as I'm able to show it on IE at least. I searched on the internet about it and read some stuff but none of them were useful enough. Please Help.  Thanks, Tiji I have no clue. You need a PPT plugin. Maybe you could convert the PPT to PDF. Download prohibited? No problem. CHAT from any browser, without download. Go to http://in.webmessenger.yahoo.com/ If the user has M$ Office installed they should already then have the office plugin for IE (and I think there is one for Fx too) Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php http://www.authorgen.com/authorpoint-lite-free/powerpoint-to-flash-converter.aspxmay be of interest Why can't a linux user do all these cool stuff :-P ? Perhaps we should let the ice melt and drown everyone. Then we can rebuild a world where a *nix user can handle everything without COM. PS Yeah right like you could be superman or a Jedi -- Thodoris
Re: [PHP] Problem with install lybrary GD
Hi forum I try install library GD on Centos 5 I download the gd-2.0.35.tar with the next sentece ./configure --prefix=/usr/local --with=/usr/local --with-jpeg=/usr/local make make install Here all ok. And next install the php-5.2.6 ./configure (... n parameter...) --with-gd=/usr/local/lib --with-png-dir=/usr/local/bin --with-jpeg-dir=/usr/local/bin make make install And don't get any problem, all ok. But, execute in code php, the command phpinfo(); and see the next result Configure Command'./configure' ... '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-jpeg-dir=/usr' '--with-png' '--without-gd' .. And test with code in php var_dump(gd_info()); but nothing. What is wrong. Why don't work Thanks, P.D. The content the directory are: /usr/local/bin annotate bdftogd gd2copypal gd2togif gd2topng gdcmpgif gdlib-config gdparttopng gdtopng giftogd2 pngtogd pngtogd2 wcmgr webalizer webazolver webpng /usr/local/lib gd.h libgd.a libgd.la libgd.so libgd.so.2 libgd.so.2.0.0 libpcap.a In cae you are using a prepackaged php you can always do: yum install php-gd it will installed everything is need to do this. In case you have compliled php you need to recompile it with the current version of gd that you just have installed. In case the current php used to be compiled with a version of gd that you replaced (meaning installed in the exact same location) I think it might work by I wouldn't count on this. -- Thodoris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sepating MySQL result set into html tables
Thodoris wrote: Hello everybody, I have a mysql result set that I want to print out in an html table. But some times it gets so big that I will probably need to separate it in to multiple ones. I wrote a function that separates the result set into three ones like this: ... But I really need to tell the function in how many tables I need the result set to be separated. How can I do this? What can I put instead of this for 3 tables: (($j == $limit-1) || ($j == (2*$limit)-1)) I can't find the algorithm although I think I have done this before but I can't remember how. Why not just use LIMIT in your query and make several? Because this like I am paging with a limit in every table but I need to print all the tables into a single page. Why do you need to split the data into multiple tables, anyway? Because their columns are just three and if they become long you waste space in the page. $table = table class='inner'; $table .= tabletrtdtable class='inner'; That's going to give you badly-formatted HTML. Yes it will but I will make this better along with other things as long as I find the needed algorithm. -- Thodoris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sepating MySQL result set into html tables
Might I suggest you count the fields and divide it by the cols you want to display? Example: $forest = mysql_query(SELECT * FROM your_table); $gump = mysql_num_fields($forest); Because I know my table contains 15 rows I can do this. $tulip = floor($gump /5); I know how many fields to display before row break or create a new table. May seems extremely simple but works very well for me. Thodoris wrote: Hello everybody, I have a mysql result set that I want to print out in an html table. But some times it gets so big that I will probably need to separate it in to multiple ones. I wrote a function that separates the result set into three ones like this: ... But I really need to tell the function in how many tables I need the result set to be separated. How can I do this? What can I put instead of this for 3 tables: (($j == $limit-1) || ($j == (2*$limit)-1)) I can't find the algorithm although I think I have done this before but I can't remember how. Why not just use LIMIT in your query and make several? Why do you need to split the data into multiple tables, anyway? $table = table class='inner'; $table .= tabletrtdtable class='inner'; That's going to give you badly-formatted HTML. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sepating MySQL result set into html tables
Might I suggest you count the fields and divide it by the cols you want to display? Example $forest = mysql_query(SELECT * FROM your_table); $gump = mysql_num_fields($forest); Because I know my table contains 15 rows I can do this. $tulip = floor($gump /5); I know how many fields to display before a row break. May seems extremely simple but works very well for me. Hello everybody, I have a mysql result set that I want to print out in an html table. But some times it gets so big that I will probably need to separate it in to multiple ones. I wrote a function that separates the result set into three ones like this: function showTable($columnNames,$data,$alignment,$wrap) { $limit = round(count($data)/3,0); $align = array('l'='align=left','c'='align=center','r'='align=right'); $table = table class='inner'; $table .= tabletrtdtable class='inner'; $table .= tr; foreach ($columnNames as $col_name){ $table .= th.$col_name./th; } $table .= /tr\n; foreach ($data as $j = $row) { if(($j % 2) == 0){ $table .= tr class=even; } else { $table .= tr class=odd; } for($i=0;$icount($row);$i++){ $table .= td .$wrap. .$align[$alignment[$i]]..$row[$i]./td; } $table .= /tr\n; if (($j == $limit-1) || ($j == (2*$limit)-1)) { $table .= /table/tdtdtable; $table .= tr; foreach ($columnNames as $col_name){ $table .= th.$col_name./th; } $table .= /tr\n; } } $table .= '/table/td/tr'; $table .= /table\n; print $table; } But I really need to tell the function in how many tables I need the result set to be separated. How can I do this? What can I put instead of this for 3 tables: (($j == $limit-1) || ($j == (2*$limit)-1)) I can't find the algorithm although I think I have done this before but I can't remember how. -- Thodoris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sepating MySQL result set into html tables
On Fri, 2008-09-26 at 13:50 -0400, [EMAIL PROTECTED] wrote: Might I suggest you count the fields and divide it by the cols you want to display? Example $forest = mysql_query(SELECT * FROM your_table); $gump = mysql_num_fields($forest); Because I know my table contains 15 rows I can do this. $tulip = floor($gump /5); You have a bug if you have 16 rows. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] JSON in PHP5?
The json extension is included as default if the debug option is enabled, but the json extension isn't included if the debug option is disabled. Bummer! - Original Message From: Nathan Nobbe [EMAIL PROTECTED] To: Dan Zilavy [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Friday, September 26, 2008 9:39:53 AM Subject: Re: [PHP] JSON in PHP5? On Fri, Sep 26, 2008 at 9:19 AM, Nathan Nobbe [EMAIL PROTECTED]wrote: did you configure w/ --disable-json ? heres a way to run a quick test from the command line, php -i | grep json if that doesnt say 'enabled' on one of the lines youll have to recompile php and not provide --disable-json to configure. -nathan ps. sorry for additional noise
RE: [PHP] Passing Variables to an iframe
Anybody can see it and change it. All user input, which always includes GET/POST/COOKIE data is always untrustworthy. -Original Message- From: Waynn Lue [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2008 6:17 AM To: PHP General list Subject: [PHP] Passing Variables to an iframe This may be more a general HTML question, so let me know if I should post somewhere else. I was hoping to do some logic in a script, and then pass the results of that script to an iframe for more processing. Is it secure to include those variables as get parameters to the iframe, though? In other words, if I have something like this: iframe src=http://example.com/?accesseverything=true; where I use PHP to generate the src for the iframe. Could someone just use Firebug or something to set that variable? Is there a better way of passing it instead? Thanks, Waynn ___ The information in this email or in any file attached hereto is intended only for the personal and confiden- tial use of the individual or entity to which it is addressed and may contain information that is propri- etary and confidential. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communica- tion is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product. Email trans- mission cannot be guaranteed to be secure or error- free. P6070214 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] JSON in PHP5?
On Fri, Sep 26, 2008 at 11:00 AM, Dan Zilavy [EMAIL PROTECTED] wrote: The json extension is included as default if the debug option is enabled, but the json extension isn't included if the debug option is disabled. Bummer! i don't use debug and it is there just fine. are you -sure- there's not something else going on? :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] JSON in PHP5?
With debug enable php -m shows json present and without debug json isn't. BTW, I'm on FreeBSD 7.0 if that makes a difference. - Original Message From: mike [EMAIL PROTECTED] To: Dan Zilavy [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Friday, September 26, 2008 12:12:47 PM Subject: Re: [PHP] JSON in PHP5? On Fri, Sep 26, 2008 at 11:00 AM, Dan Zilavy [EMAIL PROTECTED] wrote: The json extension is included as default if the debug option is enabled, but the json extension isn't included if the debug option is disabled. Bummer! i don't use debug and it is there just fine. are you -sure- there's not something else going on? :)
Re: [PHP] JSON in PHP5?
I rebuild again without debug and now it's working. Go figure! Thanks for the help all. - Original Message From: mike [EMAIL PROTECTED] To: Dan Zilavy [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Friday, September 26, 2008 12:12:47 PM Subject: Re: [PHP] JSON in PHP5? On Fri, Sep 26, 2008 at 11:00 AM, Dan Zilavy [EMAIL PROTECTED] wrote: The json extension is included as default if the debug option is enabled, but the json extension isn't included if the debug option is disabled. Bummer! i don't use debug and it is there just fine. are you -sure- there's not something else going on? :)
Re: [PHP] Sepating MySQL result set into html tables
On Fri, 2008-09-26 at 13:50 -0400, [EMAIL PROTECTED] wrote: Might I suggest you count the fields and divide it by the cols you want to display? Example $forest = mysql_query(SELECT * FROM your_table); $gump = mysql_num_fields($forest); First of all the problem is with the rows not the columns. The problem is that I want to divide the rows into equal (or anything close to that) chunks and put every chunk in a separate table. There I said it :-) . Because I know my table contains 15 rows I can do this. $tulip = floor($gump /5); You can count the rows (not the cols) in the result set but you can't base your algorithm on that only. The problem is that if for e.g. you have 91 rows and you want to divide it into 3 you will have three chunks of 30 like this: 30, 30, 31 You have a bug if you have 16 rows. In my case I really don't care in what table the extra row goes. Cheers, Rob. -- Thodoris
Re: [PHP] JSON in PHP5?
With debug enable php -m shows json present and without debug json isn't. BTW, I'm on FreeBSD 7.0 if that makes a difference. - Original Message From: mike [EMAIL PROTECTED] To: Dan Zilavy [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Friday, September 26, 2008 12:12:47 PM Subject: Re: [PHP] JSON in PHP5? On Fri, Sep 26, 2008 at 11:00 AM, Dan Zilavy [EMAIL PROTECTED] wrote: The json extension is included as default if the debug option is enabled, but the json extension isn't included if the debug option is disabled. Bummer! i don't use debug and it is there just fine. are you -sure- there's not something else going on? :) First of all it would help a lot if you changed the way you post. It really makes a difference what you use to host PHP because different compile options are used by different distros. In addition to this when you complile yourself from PHP source it adds any feature it finds available depending on the system libraries and many other things that detects . FreeBSD ports have their own defaults but you may change them when you install the port. So the answer is simple: Whether you have or not Json depends on the distro/OS/system package defaults. Why don't you tell us what is the system and how you have installed PHP? Someone could be more knowledgeable of your system specifics. -- Thodoris
Re: [PHP] Sepating MySQL result set into html tables
On Fri, 2008-09-26 at 21:23 +0300, Thodoris wrote: On Fri, 2008-09-26 at 13:50 -0400, [EMAIL PROTECTED] wrote: Might I suggest you count the fields and divide it by the cols you want to display? Example $forest = mysql_query(SELECT * FROM your_table); $gump = mysql_num_fields($forest); First of all the problem is with the rows not the columns. The problem is that I want to divide the rows into equal (or anything close to that) chunks and put every chunk in a separate table. There I said it :-) . Because I know my table contains 15 rows I can do this. $tulip = floor($gump /5); You can count the rows (not the cols) in the result set but you can't base your algorithm on that only. The problem is that if for e.g. you have 91 rows and you want to divide it into 3 you will have three chunks of 30 like this: 30, 30, 31 You have a bug if you have 16 rows. In my case I really don't care in what table the extra row goes. The solution is pretty easy, I just don't have time right now to write it for you. Either way, I would approach the problem inverseley to your current solution. Instead of traversing the rows and performing internal calculations, I'd calculate the tables and rows needed and then traverse that information and in the innermost loop traverse the result set using the next() function. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sepating MySQL result set into html tables
On Fri, Sep 26, 2008 at 2:41 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2008-09-26 at 21:23 +0300, Thodoris wrote: On Fri, 2008-09-26 at 13:50 -0400, [EMAIL PROTECTED] wrote: Might I suggest you count the fields and divide it by the cols you want to display? Example $forest = mysql_query(SELECT * FROM your_table); $gump = mysql_num_fields($forest); First of all the problem is with the rows not the columns. The problem is that I want to divide the rows into equal (or anything close to that) chunks and put every chunk in a separate table. There I said it :-) . Because I know my table contains 15 rows I can do this. $tulip = floor($gump /5); You can count the rows (not the cols) in the result set but you can't base your algorithm on that only. The problem is that if for e.g. you have 91 rows and you want to divide it into 3 you will have three chunks of 30 like this: 30, 30, 31 You have a bug if you have 16 rows. In my case I really don't care in what table the extra row goes. The solution is pretty easy, I just don't have time right now to write it for you. Either way, I would approach the problem inverseley to your current solution. Instead of traversing the rows and performing internal calculations, I'd calculate the tables and rows needed and then traverse that information and in the innermost loop traverse the result set using the next() function. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php When I need to do something like this I always use this base code that I just edit. I wrote it a few years ago and haven't really changed it so it works for what I need. ?php $results= 17; // how many cells do we actually have data for? [put your record count here] $cols = 8; // desired column width of the table $total = $cols * ceil($results / $cols); // total cells to create $rows = ceil($total / $cols);// total rows to create $position = 0; // current position echo brresults: ,$results; echo brcols: , $cols; echo brtotal: , $total; ? table border=1 ?php for ($row=0; $row $rows; ++$row): ? tr ?php for ($col=0; $col $cols; ++$col): ? ?php if ($results $position): ? td ?php // call your fetch record code here echo 'Col: '. $col .'br'; echo 'Row: '. $row .'br'; echo 'Position: '. $position .'br'; ? /td ?php else: ? td empty cell /td ?php endif; ? ?php ++$position; ? ?php endfor; ? /tr ?php endfor; ? /table -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Remove an element from associative array
Hi, is there any predefined function in php that allows to remove an element from an associative array? Thank you -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Remove an element from associative array
On 26 Sep 2008, at 21:15, It flance wrote: is there any predefined function in php that allows to remove an element from an associative array? http://php.net/unset unset($array['key']); -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sepating MySQL result set into html tables
On Fri, Sep 26, 2008 at 2:41 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2008-09-26 at 21:23 +0300, Thodoris wrote: On Fri, 2008-09-26 at 13:50 -0400, [EMAIL PROTECTED] wrote: Might I suggest you count the fields and divide it by the cols you want to display? Example $forest = mysql_query(SELECT * FROM your_table); $gump = mysql_num_fields($forest); First of all the problem is with the rows not the columns. The problem is that I want to divide the rows into equal (or anything close to that) chunks and put every chunk in a separate table. There I said it :-) . Because I know my table contains 15 rows I can do this. $tulip = floor($gump /5); You can count the rows (not the cols) in the result set but you can't base your algorithm on that only. The problem is that if for e.g. you have 91 rows and you want to divide it into 3 you will have three chunks of 30 like this: 30, 30, 31 You have a bug if you have 16 rows. In my case I really don't care in what table the extra row goes. The solution is pretty easy, I just don't have time right now to write it for you. Either way, I would approach the problem inverseley to your current solution. Instead of traversing the rows and performing internal calculations, I'd calculate the tables and rows needed and then traverse that information and in the innermost loop traverse the result set using the next() function. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php When I need to do something like this I always use this base code that I just edit. I wrote it a few years ago and haven't really changed it so it works for what I need. ?php $results= 17; // how many cells do we actually have data for? [put your record count here] $cols = 8; // desired column width of the table $total = $cols * ceil($results / $cols); // total cells to create $rows = ceil($total / $cols);// total rows to create $position = 0; // current position echo brresults: ,$results; echo brcols: , $cols; echo brtotal: , $total; ? table border=1 ?php for ($row=0; $row $rows; ++$row): ? tr ?php for ($col=0; $col $cols; ++$col): ? ?php if ($results $position): ? td ?php // call your fetch record code here echo 'Col: '. $col .'br'; echo 'Row: '. $row .'br'; echo 'Position: '. $position .'br'; ? /td ?php else: ? td empty cell /td ?php endif; ? ?php ++$position; ? ?php endfor; ? /tr ?php endfor; ? /table As posted before Eric rows is the problem not columns...
Re: [PHP] Sepating MySQL result set into html tables
On Fri, Sep 26, 2008 at 4:43 PM, Thodoris [EMAIL PROTECTED] wrote: On Fri, Sep 26, 2008 at 2:41 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2008-09-26 at 21:23 +0300, Thodoris wrote: On Fri, 2008-09-26 at 13:50 -0400, [EMAIL PROTECTED] wrote: Might I suggest you count the fields and divide it by the cols you want to display? Example $forest = mysql_query(SELECT * FROM your_table); $gump = mysql_num_fields($forest); First of all the problem is with the rows not the columns. The problem is that I want to divide the rows into equal (or anything close to that) chunks and put every chunk in a separate table. There I said it :-) . Because I know my table contains 15 rows I can do this. $tulip = floor($gump /5); You can count the rows (not the cols) in the result set but you can't base your algorithm on that only. The problem is that if for e.g. you have 91 rows and you want to divide it into 3 you will have three chunks of 30 like this: 30, 30, 31 You have a bug if you have 16 rows. In my case I really don't care in what table the extra row goes. The solution is pretty easy, I just don't have time right now to write it for you. Either way, I would approach the problem inverseley to your current solution. Instead of traversing the rows and performing internal calculations, I'd calculate the tables and rows needed and then traverse that information and in the innermost loop traverse the result set using the next() function. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php When I need to do something like this I always use this base code that I just edit. I wrote it a few years ago and haven't really changed it so it works for what I need. ?php $results= 17; // how many cells do we actually have data for? [put your record count here] $cols = 8; // desired column width of the table $total = $cols * ceil($results / $cols); // total cells to create $rows = ceil($total / $cols);// total rows to create $position = 0; // current position echo brresults: ,$results; echo brcols: , $cols; echo brtotal: , $total; ? table border=1 ?php for ($row=0; $row $rows; ++$row): ? tr ?php for ($col=0; $col $cols; ++$col): ? ?php if ($results $position): ? td ?php // call your fetch record code here echo 'Col: '. $col .'br'; echo 'Row: '. $row .'br'; echo 'Position: '. $position .'br'; ? /td ?php else: ? td empty cell /td ?php endif; ? ?php ++$position; ? ?php endfor; ? /tr ?php endfor; ? /table As posted before Eric rows is the problem not columns... Oh sorry I didn't read it close enough. If $data is already an array this would be really easy with array_chunk. Otherwise you just need to add an extra layer around your main table loop. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Variables to an iframe
Ah, that makes sense. Given all the input on this thread, I'll see if I can get sessions do what I want. Thanks! Waynn
Re: [PHP] Sepating MySQL result set into html tables
On Fri, 2008-09-26 at 14:41 -0400, Robert Cummings wrote: On Fri, 2008-09-26 at 21:23 +0300, Thodoris wrote: On Fri, 2008-09-26 at 13:50 -0400, [EMAIL PROTECTED] wrote: Might I suggest you count the fields and divide it by the cols you want to display? Example $forest = mysql_query(SELECT * FROM your_table); $gump = mysql_num_fields($forest); First of all the problem is with the rows not the columns. The problem is that I want to divide the rows into equal (or anything close to that) chunks and put every chunk in a separate table. There I said it :-) . Because I know my table contains 15 rows I can do this. $tulip = floor($gump /5); You can count the rows (not the cols) in the result set but you can't base your algorithm on that only. The problem is that if for e.g. you have 91 rows and you want to divide it into 3 you will have three chunks of 30 like this: 30, 30, 31 You have a bug if you have 16 rows. In my case I really don't care in what table the extra row goes. The solution is pretty easy, I just don't have time right now to write it for you. Either way, I would approach the problem inverseley to your current solution. Instead of traversing the rows and performing internal calculations, I'd calculate the tables and rows needed and then traverse that information and in the innermost loop traverse the result set using the next() function. ?php $cells = array( 'First', 'Second' ); $items = array( array( 'one', 'two' ), array( 'one', 'two' ), array( 'one', 'two' ), array( 'one', 'two' ), array( 'one', 'two' ), arr $numTables = 3; $items = array_chunk( $items, ceil( count( $items ) / $numTables ) ); $html = ''; foreach( $items as $tableItems ) { if( $tableItems ) { $html .= 'tabletr'; foreach( $cells as $cell ) { $html .= 'td'.$cell.'/td'; } $html .= '/tr'; foreach( $tableItems as $rowItems ) { $html .= 'tr'; foreach( $rowItems as $item ) { $html .= 'td'.$item.'/td'; } $html .= '/tr'; } $html .= '/table'; } } ? I changed my mind on how I wanted to do it. Either way... simple enough :) Adapt to fit your own scenario. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The Data Literacy Test: Interpretation Added
Actually, I think the author meant that you already read through those books and learned those terms, rather than mean that you are cheating on the test. As the author recommended you read the books listed below if you are not an expert yet. Those recommended books are also added on the interpretation page for your reference. 2008/9/26 Robert Cummings [EMAIL PROTECTED] On Fri, 2008-09-26 at 14:02 +0800, Shelley wrote: Fyi, The interpretation of the score is added. Welcome to check your programming knowledge level: http://www.phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test :) From the interpretation: 20–24 You are an expert programmer. You probably already have the books listed below on your shelf. *lol* Why would probably be applicable in this scenario? More likely most people hit up google to answer their questions. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- With best regards, Shelley Shyan http://phparch.cn
Re: [PHP] The Data Literacy Test: Interpretation Added
2008/9/26 tedd [EMAIL PROTECTED] At 2:02 PM +0800 9/26/08, Shelley wrote: Fyi, The interpretation of the score is added. Welcome to check your programming knowledge level: http://www.phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test :) The answer as I see it is 27. While we both agree that elongated stream, retroactive synapse, and value chain are false computer terms, there are three that you apparently don't know. ??? What is three, excuse me? Would you care point those out so we can discuss them? This reminds me of a survey I conducted in the late 80's where I had section of computer terms for people to indicate what was familiar, or not. The answer of each was either I heard of it, I know it, or Huh? I used that answer to test the truth of the person taking the survey. Interesting enough, I found the ratio of truth was equally spread between all age groups. In other words, the 20-30, 31-40, 41-50, 51-60 age groups all had the same ratio of people reporting a false term as I know it. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- With best regards, Shelley Shyan http://phparch.cn
Re: [PHP] The Data Literacy Test: Interpretation Added
On Sat, 2008-09-27 at 13:02 +0800, Shelley wrote: Actually, I think the author meant that you already read through those books and learned those terms, rather than mean that you are cheating on the test. As the author recommended you read the books listed below if you are not an expert yet. Those recommended books are also added on the interpretation page for your reference. No, what I was getting at was that I knew almost all the terms and don't think I've read any of the books... possibly the first in university but I can't remember and the book is buried in a box someplace. These days one can learn all the information contained in the books via the web. BTW, I thought value chain was a real concept but you indicate it is garbage. In OOP many would consider the following to be a value chain: $foo-fee-fii-foo-fum I didn't consider myself pompous at all for that interpretation. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php