Re: [PHP] Looking for help with forms/variables and an array!
Here is a link to the reworked source ran through highlight_file() so you can see the comments and such. I think I have caught everything that I can think of. Of course, not having the DB structure data to work with, I had to guess at a few things. Hope I got it right... http://www.cmsws.com/examples/php/[EMAIL PROTECTED]/index.php here is the working source http://www.cmsws.com/examples/php/[EMAIL PROTECTED]/index.phps Hope this helps, AND works :) Let me know Jim Lucas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Going from simple to super CAPTCHA
On 12/06/07, Richard Lynch [EMAIL PROTECTED] wrote: On Tue, June 12, 2007 9:33 am, Tijnema wrote: I meant reverse order :P That would be pretty broken. There's no guarantee that browsers will present the inputs in any order at all, even though they all seem (so far) to follow the convention of presenting them in the order they appear in the form. If, however, one browser decides tomorrow to use the tab order instead, and your code breaks because of that, it's your fault, not the browser's. The HTML spec says that form elements should be presented in the order they appear in the document. If the browser doesn't conform to spec, it's not his fault. From the HTML 4.01 Specification: The control names/values are listed in the order they appear in the document. The name is separated from the value by `=' and name/value pairs are separated from each other by `'. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP list as a blog
2007. 06. 13, szerda keltezéssel 07.20-kor Paul Scott ezt írta: On Tue, 2007-06-12 at 16:02 -0500, Richard Lynch wrote: OK, downed it. Will figure out a regular expression to strip out the email addresses when I have had some coffee in the morning I have added a regex to strip out the mail addresses and replace them with a message saying that they have been removed. I will put this list back on now for a test period if that is OK? is this the link: http://196.21.45.50/fsiu/chisimba_framework/app/index.php?module=blogaction=allblogs ? (this was in your original post) because it just throws a basic 404 at me ;) greets Zoltán Németh Thanks all for the feedback, I really appreciate it! --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- 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] PHP list as a blog
On Wed, 2007-06-13 at 12:08 +0200, Zoltán Németh wrote: is this the link: http://196.21.45.50/fsiu/chisimba_framework/app/index.php?module=blogaction=allblogs ? (this was in your original post) No, sorry, I have just updated the DNS. Try http://fsiu.uwc.ac.za/ now. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need to collect credit card details
Please include the list when replying. [EMAIL PROTECTED] wrote: I know what you mean, however it is very common in his business to hold them as security if guests do not turn up. Then he takes a non-refundable deposit or full payment at the time of booking. If you try to implement a secure way of doing what he wants you're entering a world of pain. IMHO It's just not worth it. But it's yours and his funerals, so it's up to you. The most secure way to do it will be to do it all under SSL, but you then need to make sure that wherever you're storing them is also secure, both physically and virtually. Pain... a whole world of it. -Stut - Original Message - From: Stut [EMAIL PROTECTED] To: Ross [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Wednesday, June 13, 2007 10:59 AM Subject: Re: [PHP] need to collect credit card details Ross wrote: I have a paypal account setup and am going to upgrade to the virtual terminal, however the client would like to collect the credit card details as security (he is a hotelier) Is it possible to securely send these details via the internet or should I suggest he just gets them to phone them through? You need to tell your client he's an idiot. Credit card details are hot potatos - don't hold on to them any longer than necessary or you're likely to get very badly burnt! -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need to collect credit card details
Ross wrote: I have a paypal account setup and am going to upgrade to the virtual terminal, however the client would like to collect the credit card details as security (he is a hotelier) Is it possible to securely send these details via the internet or should I suggest he just gets them to phone them through? You need to tell your client he's an idiot. Credit card details are hot potatos - don't hold on to them any longer than necessary or you're likely to get very badly burnt! -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sending mail from localhost
I usually use a phpmailer class but am creating something from scratch. when I use the most basic example I can find: $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); I get this error mail.blue-fly.co.uk: sender address must contain a domain I am trying to send via my mail so have changed the lines in .ini to [mail function] ; For Win32 only. SMTP = mail.blue-fly.co.uk smtp_port = 25 ; For Win32 only. sendmail_from = mail.blue-fly.co.uk Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sending mail from localhost
Ross wrote: ; For Win32 only. sendmail_from = mail.blue-fly.co.uk This should be an email address not just a domain. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP list as a blog
Paul Scott wrote: I have set up our new Chisimba blog system (GPL, http://avoir.uwc.ac.za) to blog all of the posts to this list. Please check it out at http://196.21.45.50/fsiu/chisimba_framework/app/index.php?module=blogaction=allblogs and let me know what you think! Erm, reinventing the wheel? http://blog.gmane.org/gmane.comp.php.general I always use/view the PHP list via gmane (I'm not subscribed). I use Thunderbird's NNTP reader and gmanes NNTP server. It works like a charm and saves a lot of hassle subscribing to mailing lists :) Check it out: http://www.gmane.org/ Col. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP list as a blog
2007. 06. 13, szerda keltezéssel 12.11-kor Paul Scott ezt írta: On Wed, 2007-06-13 at 12:08 +0200, Zoltán Németh wrote: is this the link: http://196.21.45.50/fsiu/chisimba_framework/app/index.php?module=blogaction=allblogs ? (this was in your original post) No, sorry, I have just updated the DNS. Try http://fsiu.uwc.ac.za/ now. okay, that works. just one problem: the UTF-8 characters are screwed up (for example á and é in my name - I send my mails in UTF-8 so that cannot be the problem) greets Zoltán Németh --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP list as a blog
On Wed, 2007-06-13 at 11:51 +0100, Colin Guthrie wrote: Erm, reinventing the wheel? Not quite, more of a test of the code so that I know that Bad Things do not happen when there is a lot of traffic/posts. If it serves another purpose (like letting students etc see what is happening) all the better. I notice that gmane blogs do not obfuscate the email addresses of senders though. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP list as a blog
On Wed, 2007-06-13 at 12:57 +0200, Zoltán Németh wrote: okay, that works. just one problem: the UTF-8 characters are screwed up (for example á and é in my name - I send my mails in UTF-8 so that cannot be the problem) I noticed. What we did was tack this site (which normally runs of postgres) to an older version MySQL (I think its 4.1 or so) that may or may not have the UTF-8 stuff enabled on it. I will get the mysql admins to fix it as soon as possible. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP list as a blog
Paul Scott wrote: On Wed, 2007-06-13 at 11:51 +0100, Colin Guthrie wrote: Erm, reinventing the wheel? Not quite, more of a test of the code so that I know that Bad Things do not happen when there is a lot of traffic/posts. If it serves another purpose (like letting students etc see what is happening) all the better. I notice that gmane blogs do not obfuscate the email addresses of senders though. Depends on the list settings - it can be turned on with the flick of a switch... just ask the guys at Gmane. It's quite annoying for trying to contact someone tho' :) For example, via NNTP here I can see your address, but on e.g. the KDE Imaging mailing list they are all messed up! Col. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP list as a blog
On Wed, 2007-06-13 at 12:26 +0100, Colin Guthrie wrote: Depends on the list settings - it can be turned on with the flick of a switch... just ask the guys at Gmane. Sure, but most lists do not do this by default... It's quite annoying for trying to contact someone tho' :) It's even more annoying getting a zillion spammers knocking over your mailserver for no reason. :) --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Redirecting to a parent page
Im using this instruction header( refresh:'3'; url=./file3.php); But I got the error that in http://localhost/file3.php does not exists any page What's the absolute path to file3.php? If it's in DocumentRoot, then use /file3.php (no dot). -- @~@ Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Xubuntu 7.04) Linux 2.6.21.5 ^ ^ 20:30:01 up 23:58 0 users load average: 0.03 0.03 0.00 news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] need to collect credit card details
I have a paypal account setup and am going to upgrade to the virtual terminal, however the client would like to collect the credit card details as security (he is a hotelier) Is it possible to securely send these details via the internet or should I suggest he just gets them to phone them through? You need to use an encrypted link, like SSL. But there are almost certainly safer ways to accomplish your goals than handling credit cards yourself. The fact that you ask this question suggests that you and your client might have not thoroughly thought through the implications. Generally, it is a really, really BAD idea to store credit card information (on systems, on paper slips, on post-it notes). One little oversight, one little compromise, and all of a sudden you have potentially 1000s of YOUR CUSTOMER'S credit cards leaked into who knows who's hands. Assuming you're lucky enough to know that it has happened at all, you will then be faced with cleaning the whole mess up. Irrepairable damage will have been done to your, and your client's reputations. The legal ramifications are staggering. Make sure you get a signed release from liability from your client so he can't come after you if he gets sued. If you consider the implications and decide to go forward anyway, I suggest you read a LOT about internet security. http://phpsec.org/library/ is a great place to start with regards to the PHP aspects of this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [BULK] [PHP] Redirecting to a parent page
Yamil Ortega wrote: Lets say that I have the next structure on my web directory /file1.php /procces/file2.php /file3.php http://localhost/apache2/file1.php try this: header( refresh:'3'; url=./apache2/file3.php); Regards, Clive. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need to collect credit card details
Ross wrote: I have a paypal account setup and am going to upgrade to the virtual terminal, however the client would like to collect the credit card details as security (he is a hotelier) no he doesn't, no you don't. you are not visa, you are not paypal, you are not fill in the name of arbitrary insanely rich bank/payment providing corporation. he wants 'security' - find out what that means and figure out how to give it to him without bringing CC numbers into the equation (someone mentioned deposits - which can be recieved without actually touching the CC numbers). if the client insists on having CC number as security then tell him to find some other idiot to implement it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Address validation API's for PHP
Good morning group, I am doing some searching and researching but I also know that this world famous group may have some insight and resources that I can benefit from. I am looking for an address validation database and API to use with our retail applications (does not have to be free). I would prefer to be able to buy data according to postal code. I will likely use AJAX to take an address that is input into the system and find a similar or better address and then offer the user the opportunity to use the returned address or the one that they put into the system. You have all seen this in operation if you use maps.google.com when it does not flat out recognize the address. Is anyone aware of anything like this that they can point me to? Thanks very much in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Wed, 2007-06-13 at 07:45 -0500, Jay Blanchard wrote: I am looking for an address validation database and API to use with our retail applications (does not have to be free). Not sure entirely of what you are looking for here, but try http://www.geonames.org first. It's CC licenced so that sweetens the pot even more. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Going from simple to super CAPTCHA
On 6/13/07, Jake McHenry [EMAIL PROTECTED] wrote: I've been reading along, very informative :) I found Osama within 20 seconds and as someone posted already, looking for his head wouldn't be much of a task for a computer. It's just for if you want to keep normal people out ;) Has anyone tried cracking/hacking what Microsoft has done with the animal pictures? That seems rather easy for even preschoolers, but a human non the less. They have many people working on this exact subject, and being paid I'm sure more than what its worth, but is there even a discussion if they have the answer? Other than the completely blind, anyone can tell what a cat is, and they could even take it further by added a bark or meow or something similar. Can a computer tell the difference between a bark and a meow? Each animal has its unique vocal tones and cry signature... just as a human (who's not impersonating, which as long as its not a picture of the mocking bird...), does this help at all? Instead of relying on our own known dictionary and numbers Everyone knows about animals.. My 0.02 Jake snip I know about the microsoft way, but I wouldn't trust a Microsoft CAPTCHA program.. :P MD5 is quite successfull here, since they aren't modifieng the image in any way. Everyone knows animals, but if you then you can't use this CAPTCHA on any site on other language, unless you of course translate the names of the animals ;) I think I'll start with some kind of SCAPTCHA (Super CAPTCHA) soon.. Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: need to collect credit card details
I wasn't keen to do this anyway. A deposit it is. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On 6/13/07, Jay Blanchard [EMAIL PROTECTED] wrote: Good morning group, Actually, it was 2:45 PM here when you've sent this message :P I am doing some searching and researching but I also know that this world famous group may have some insight and resources that I can benefit from. I am looking for an address validation database and API to use with our retail applications (does not have to be free). I would prefer to be able to buy data according to postal code. I will likely use AJAX to take an address that is input into the system and find a similar or better address and then offer the user the opportunity to use the returned address or the one that they put into the system. You have all seen this in operation if you use maps.google.com when it does not flat out recognize the address. Is anyone aware of anything like this that they can point me to? Thanks very much in advance. You can download a complete database here: http://download.geonames.org/export/dump/ Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need a more elegant way of bitwise ORing values
Hi all, Can anyone think of a more elegant way of achieving the following? ?php $flags = array(); if ($allow_fraction) { $flags[] = FILTER_FLAG_ALLOW_FRACTION; } if ($allow_thousand) { $flags[] = FILTER_FLAG_ALLOW_THOUSAND; } if ($allow_scientific) { $flags[] = FILTER_FLAG_ALLOW_SCIENTIFIC; } if (count($flags) 0) { $c = '$c = ' . implode('|', $flags) . ';'; eval($c); $filter['flags'] = $c; } ? The code checks for 3 booleans ($allow_fraction, etc) and if true it adds the const to the $flags array. At the end each value in the array is joined together into a string (the implode part), which would give something like: 4096|8192 - but I then need to return the actual value from this operation, so I'm eval'ing it. I don't like using eval, so can anyone think of a better way to do this? All I need as an end result if the product of the bitwise operation (i.e. an integer) stored in $filter['flags'] Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk Never trust a computer you can't throw out of a window -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a more elegant way of bitwise ORing values
2007. 06. 13, szerda keltezéssel 14.13-kor Richard Davey ezt írta: Hi all, Can anyone think of a more elegant way of achieving the following? ?php $flags = array(); if ($allow_fraction) { $flags[] = FILTER_FLAG_ALLOW_FRACTION; } if ($allow_thousand) { $flags[] = FILTER_FLAG_ALLOW_THOUSAND; } if ($allow_scientific) { $flags[] = FILTER_FLAG_ALLOW_SCIENTIFIC; } if (count($flags) 0) { $tmp = FALSE; foreach ($flags as $flag) { $tmp = $tmp | $flag; } $filter['flags'] = $tmp; greets Zoltán Németh $c = '$c = ' . implode('|', $flags) . ';'; eval($c); $filter['flags'] = $c; } ? The code checks for 3 booleans ($allow_fraction, etc) and if true it adds the const to the $flags array. At the end each value in the array is joined together into a string (the implode part), which would give something like: 4096|8192 - but I then need to return the actual value from this operation, so I'm eval'ing it. I don't like using eval, so can anyone think of a better way to do this? All I need as an end result if the product of the bitwise operation (i.e. an integer) stored in $filter['flags'] Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk Never trust a computer you can't throw out of a window -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Need a more elegant way of bitwise ORing values
Hi Zoltán, Wednesday, June 13, 2007, 2:21:18 PM, you wrote: 2007. 06. 13, szerda keltezéssel 14.13-kor Richard Davey ezt írta: Hi all, Can anyone think of a more elegant way of achieving the following? ?php $flags = array(); if ($allow_fraction) { $flags[] = FILTER_FLAG_ALLOW_FRACTION; } if ($allow_thousand) { $flags[] = FILTER_FLAG_ALLOW_THOUSAND; } if ($allow_scientific) { $flags[] = FILTER_FLAG_ALLOW_SCIENTIFIC; } if (count($flags) 0) { $tmp = FALSE; foreach ($flags as $flag) { $tmp = $tmp | $flag; } $filter['flags'] = $tmp; Nice one, thank you. Same amount of code but avoids the eval() which is all I wanted. Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk Never trust a computer you can't throw out of a window -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: [BULK] [PHP] Redirecting to a parent page
Ok, but what happens if I change server and there is no more apache2 directory? Do I have to change all the headers in my 37 web pages? Thanks in advance Yamil -Mensaje original- De: clive [mailto:[EMAIL PROTECTED] Enviado el: Miércoles, 13 de Junio de 2007 05:37 a.m. Para: PHP General List Asunto: [PHP] Re: [BULK] [PHP] Redirecting to a parent page Yamil Ortega wrote: Lets say that I have the next structure on my web directory /file1.php /procces/file2.php /file3.php http://localhost/apache2/file1.php try this: header( refresh:'3'; url=./apache2/file3.php); Regards, Clive. -- 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] Address validation API's for PHP
On Wed, 2007-06-13 at 07:45 -0500, Jay Blanchard wrote: Good morning group, I am doing some searching and researching but I also know that this world famous group may have some insight and resources that I can benefit from. Your wish shall be answered. You can prevent dangling prepositions, such as the one above, by rearranging your sentence a little. I am doing some searching and researching but I also know that this world famous group may have some insight and resources that I can benefit from. Would become: I am doing some searching and researching but I also know that this world famous group may have some insight and resources that from which I can benefit. I am looking for an address validation database and API to use with our retail applications (does not have to be free). I would prefer to be able to buy data according to postal code. I will likely use AJAX to take an address that is input into the system and find a similar or better address and then offer the user the opportunity to use the returned address or the one that they put into the system. You have all seen this in operation if you use maps.google.com when it does not flat out recognize the address. Is anyone aware of anything like this that they can point me to? Similarly... Is anyone aware of anything like this that they can point me to? Would become: Is anyone aware of anything like this to which they can point me? As to your actual question... no idea :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Need a more elegant way of bitwise ORing values
On 6/13/07, Richard Davey [EMAIL PROTECTED] wrote: Hi Zoltán, Wednesday, June 13, 2007, 2:21:18 PM, you wrote: 2007. 06. 13, szerda keltezéssel 14.13-kor Richard Davey ezt írta: Hi all, Can anyone think of a more elegant way of achieving the following? ?php $flags = array(); if ($allow_fraction) { $flags[] = FILTER_FLAG_ALLOW_FRACTION; } if ($allow_thousand) { $flags[] = FILTER_FLAG_ALLOW_THOUSAND; } if ($allow_scientific) { $flags[] = FILTER_FLAG_ALLOW_SCIENTIFIC; } if (count($flags) 0) { $tmp = FALSE; foreach ($flags as $flag) { $tmp = $tmp | $flag; } $filter['flags'] = $tmp; Nice one, thank you. Same amount of code but avoids the eval() which is all I wanted. Cheers, Rich Nice one, but you could also do it like this: ?php $filter['flags'] = FALSE; if ($allow_fraction) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_FRACTION; } if ($allow_thousand) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_THOUSAND; } if ($allow_scientific) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_SCIENTIFIC; } ? Little bit simpler huh? Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [BULK] [PHP] Redirecting to a parent page
Yamil Ortega wrote: Ok, but what happens if I change server and there is no more apache2 directory? Do I have to change all the headers in my 37 web pages? The same code in 37 pages??? Place the code in 1 page, and use require(my_code_page.php); where you need it in your scripts. You will only then have to change it in one place. Darren Thanks in advance Yamil -Mensaje original- De: clive [mailto:[EMAIL PROTECTED] Enviado el: Miércoles, 13 de Junio de 2007 05:37 a.m. Para: PHP General List Asunto: [PHP] Re: [BULK] [PHP] Redirecting to a parent page Yamil Ortega wrote: Lets say that I have the next structure on my web directory /file1.php /procces/file2.php /file3.php http://localhost/apache2/file1.php try this: header( refresh:'3'; url=./apache2/file3.php); Regards, Clive. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Address validation API's for PHP
[snip] You can download a complete database here: http://download.geonames.org/export/dump/ [/snip] The only problem with this is that there is not a database of street addresses. When I search for an address at maps.google.com, such as; 210 N.E. Loop 410 San Antonio, TX 78230 I get; Did you mean: NW I-410-LOOP NW I-410-LOOP, San Antonio, Bexar, TX 78230 210 NW Loop 410 210 NW Loop 410, San Antonio, Bexar, TX 78216 210 NE I-410-LOOP 210 NE I-410-LOOP, San Antonio, Bexar, TX 78216 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sending mail from localhost
On 6/13/07, Stut [EMAIL PROTECTED] wrote: Ross wrote: ; For Win32 only. sendmail_from = mail.blue-fly.co.uk This should be an email address not just a domain. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php It's also not necessary to combine single and double quotes with join marks (.'s) as you have it. While this isn't the problem, and Stut is absolutely correct, your code would look cleaner if you did it as follows: ? $to = [EMAIL PROTECTED]; $subject = Message Sent From Website; $message = Hi!\n; $message .= \tThis is also an example of how to use double quotes\n; $message .= to encapsulate special characters such as the newline\n; $message .= and tab characters. If you need to escape \quotes\ you\n; $message .= simply backslash them like above. Also, note that this\n; $message .= message can be very long by using the dot before the\n; $message .= equals sign. Another way to do this would be to use\n; $message .= HEREDOC syntax, or simply use one continuing line,\n; $message .= but that's for another time and another example.\n; $from = [EMAIL PROTECTED]; //$reply_to = [EMAIL PROTECTED]; // Same address, so not needed. // The following can be done either way. I prefer the uncommented method. // $headers = From: $from\r\n; $headers = From: .$from.\r\n; $headers .= X-Mailer: PHP.phpversion().\r\n; // Headers ALWAYS need \r\n mail($to,$subject,$message,$headers); ? More than what you asked for, but hopefully it helps. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Persistent MySQL Connection
Hi everyone, I currently running my php as cgi as it is more controllable in shared hosting, the drawback is I cannot use mysql persistent connection so mysql_pconnect() function is not an option. Is there any mysql connection pool product for php running as cgi ? Thanks, Dino -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] Need a more elegant way of bitwise ORing values
Hi Tijnema, Wednesday, June 13, 2007, 2:42:28 PM, you wrote: Nice one, but you could also do it like this: ?php $filter['flags'] = FALSE; if ($allow_fraction) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_FRACTION; } if ($allow_thousand) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_THOUSAND; } if ($allow_scientific) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_SCIENTIFIC; } ? Little bit simpler huh? Yup.. even nicer, I'm using that method now :) Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk Never trust a computer you can't throw out of a window -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: need to collect credit card details
On 6/13/07, Ross [EMAIL PROTECTED] wrote: I wasn't keen to do this anyway. A deposit it is. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Before you decide 100% on that, Ross, check out the Website Payments Pro option. It includes the Virtual Terminal, and has what's called a capture. You can take the customer's information via your form, so it doesn't even appear (at any point during the transaction) that PayPal is even involved, but then it also doesn't charge them right away. You can then enter the final settlement amount at a later time and choose to charge them or let the capture expire. As a side note, I've successfully gotten the WPP stuff set up here at work, but as it's rather new, there's not much in the way of community support or completed documentation (exempli gratia - the NVPAPIDGR document, part B - error codes --- most of the errors are less helpful than an old Perl 4 script giving the HTTP 500 ISE). Nonetheless, it's easier than it sounds. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sending mail from localhost
On Wed, 2007-06-13 at 09:51 -0400, Daniel Brown wrote: It's also not necessary to combine single and double quotes with join marks (.'s) as you have it. While this isn't the problem, and Stut is absolutely correct, your code would look cleaner if you did it as follows: ? $to = [EMAIL PROTECTED]; $subject = Message Sent From Website; $message = Hi!\n; $message .= \tThis is also an example of how to use double quotes\n; $message .= to encapsulate special characters such as the newline\n; $message .= and tab characters. If you need to escape \quotes\ you\n; $message .= simply backslash them like above. Also, note that this\n; $message .= message can be very long by using the dot before the\n; $message .= equals sign. Another way to do this would be to use\n; $message .= HEREDOC syntax, or simply use one continuing line,\n; $message .= but that's for another time and another example.\n; $message = Hi!\n .\tThis is also an example of how to use double quotes\n .to encapsulate special characters such as the newline\n .and tab characters. If you need to escape \quotes\ you\n .simply backslash them like above. Also, note that this\n .message can be very long by using the dot before the\n .equals sign. Another way to do this would be to use\n .HEREDOC syntax, or simply use one continuing line,\n .but that's for another time and another example.\n; :B Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Need a more elegant way of bitwise ORing values
2007. 06. 13, szerda keltezéssel 15.42-kor Tijnema ezt írta: On 6/13/07, Richard Davey [EMAIL PROTECTED] wrote: Hi Zoltán, Wednesday, June 13, 2007, 2:21:18 PM, you wrote: 2007. 06. 13, szerda keltezéssel 14.13-kor Richard Davey ezt írta: Hi all, Can anyone think of a more elegant way of achieving the following? ?php $flags = array(); if ($allow_fraction) { $flags[] = FILTER_FLAG_ALLOW_FRACTION; } if ($allow_thousand) { $flags[] = FILTER_FLAG_ALLOW_THOUSAND; } if ($allow_scientific) { $flags[] = FILTER_FLAG_ALLOW_SCIENTIFIC; } if (count($flags) 0) { $tmp = FALSE; foreach ($flags as $flag) { $tmp = $tmp | $flag; } $filter['flags'] = $tmp; Nice one, thank you. Same amount of code but avoids the eval() which is all I wanted. Cheers, Rich Nice one, but you could also do it like this: ?php $filter['flags'] = FALSE; if ($allow_fraction) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_FRACTION; } if ($allow_thousand) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_THOUSAND; } if ($allow_scientific) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_SCIENTIFIC; } ? Little bit simpler huh? in this case yes. but if he wants to use the $flags array to anything else besides creating $filter['flags'] from it, then my solution would be better greets Zoltán Németh Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] Need a more elegant way of bitwise ORing values
Hi Zoltán, Wednesday, June 13, 2007, 3:09:16 PM, you wrote: 2007. 06. 13, szerda keltezéssel 15.42-kor Tijnema ezt írta: On 6/13/07, Richard Davey [EMAIL PROTECTED] wrote: Hi Zoltán, Wednesday, June 13, 2007, 2:21:18 PM, you wrote: 2007. 06. 13, szerda keltezéssel 14.13-kor Richard Davey ezt írta: Hi all, Can anyone think of a more elegant way of achieving the following? ?php $flags = array(); if ($allow_fraction) { $flags[] = FILTER_FLAG_ALLOW_FRACTION; } if ($allow_thousand) { $flags[] = FILTER_FLAG_ALLOW_THOUSAND; } if ($allow_scientific) { $flags[] = FILTER_FLAG_ALLOW_SCIENTIFIC; } if (count($flags) 0) { $tmp = FALSE; foreach ($flags as $flag) { $tmp = $tmp | $flag; } $filter['flags'] = $tmp; Nice one, thank you. Same amount of code but avoids the eval() which is all I wanted. Cheers, Rich Nice one, but you could also do it like this: ?php $filter['flags'] = FALSE; if ($allow_fraction) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_FRACTION; } if ($allow_thousand) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_THOUSAND; } if ($allow_scientific) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_SCIENTIFIC; } ? Little bit simpler huh? in this case yes. but if he wants to use the $flags array to anything else besides creating $filter['flags'] from it, then my solution would be better Your solution was far better than my original, but I'm only ever setting 1 value ($filter['flags']) at the end of each function, so using the above technique will work for my requirements. Thank you both for your suggestions. Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk Never trust a computer you can't throw out of a window -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
Someone needs to smack Robert. He's off on a tangent again. ;-P On 6/13/07, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2007-06-13 at 07:45 -0500, Jay Blanchard wrote: Good morning group, I am doing some searching and researching but I also know that this world famous group may have some insight and resources that I can benefit from. Your wish shall be answered. You can prevent dangling prepositions, such as the one above, by rearranging your sentence a little. I am doing some searching and researching but I also know that this world famous group may have some insight and resources that I can benefit from. Would become: I am doing some searching and researching but I also know that this world famous group may have some insight and resources that from which I can benefit. If you want to be technical, Cummings I have been searching and researching, but I am aware that this world-famous group may be able to offer some insight and resources from which I may benefit. I am looking for an address validation database and API to use with our retail applications (does not have to be free). I would prefer to be able to buy data according to postal code. I will likely use AJAX to take an address that is input into the system and find a similar or better address and then offer the user the opportunity to use the returned address or the one that they put into the system. You have all seen this in operation if you use maps.google.com when it does not flat out recognize the address. Is anyone aware of anything like this that they can point me to? Similarly... Is anyone aware of anything like this that they can point me to? Would become: Is anyone aware of anything like this to which they can point me? and Is anyone aware of a similar system or database? As to your actual question... no idea :) Honestly, me either. I've built ZIP-code-to-longitude/latitude points, but nothing with address suggestion. Jay, are you also looking for the PLUS+4 ZIP code information? Is it possible that the USPS (if you're looking for US addresses) has a free or low-cost API? Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sending mail from localhost
On 6/13/07, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2007-06-13 at 09:51 -0400, Daniel Brown wrote: It's also not necessary to combine single and double quotes with join marks (.'s) as you have it. While this isn't the problem, and Stut is absolutely correct, your code would look cleaner if you did it as follows: ? $to = [EMAIL PROTECTED]; $subject = Message Sent From Website; $message = Hi!\n; $message .= \tThis is also an example of how to use double quotes\n; $message .= to encapsulate special characters such as the newline\n; $message .= and tab characters. If you need to escape \quotes\ you\n; $message .= simply backslash them like above. Also, note that this\n; $message .= message can be very long by using the dot before the\n; $message .= equals sign. Another way to do this would be to use\n; $message .= HEREDOC syntax, or simply use one continuing line,\n; $message .= but that's for another time and another example.\n; $message = Hi!\n .\tThis is also an example of how to use double quotes\n .to encapsulate special characters such as the newline\n .and tab characters. If you need to escape \quotes\ you\n .simply backslash them like above. Also, note that this\n .message can be very long by using the dot before the\n .equals sign. Another way to do this would be to use\n .HEREDOC syntax, or simply use one continuing line,\n .but that's for another time and another example.\n; :B Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' Yeah, I forgot the dots-and-quotes to single variable option, too. Thanks! -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[4]: [PHP] Need a more elegant way of bitwise ORing values
On Wed, 2007-06-13 at 15:05 +0100, Richard Davey wrote: Hi Tijnema, Wednesday, June 13, 2007, 2:42:28 PM, you wrote: Nice one, but you could also do it like this: ?php $filter['flags'] = FALSE; if ($allow_fraction) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_FRACTION; } if ($allow_thousand) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_THOUSAND; } if ($allow_scientific) { $filter['flags'] = $filter['flags'] | FILTER_FLAG_ALLOW_SCIENTIFIC; } ? Little bit simpler huh? Yup.. even nicer, I'm using that method now :) It's terribly verbose and inefficient... ?php $filter['flags'] = 0; if( $allow_fraction ) { $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION; } if( $allow_thousand ) { $filter['flags'] |= FILTER_FLAG_ALLOW_THOUSAND; } if( $allow_scientific ) { $filter['flags'] |= FILTER_FLAG_ALLOW_SCIENTIFIC; } ? Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Wed, 2007-06-13 at 10:13 -0400, Daniel Brown wrote: Someone needs to smack Robert. He's off on a tangent again. ;-P On 6/13/07, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2007-06-13 at 07:45 -0500, Jay Blanchard wrote: Good morning group, I am doing some searching and researching but I also know that this world famous group may have some insight and resources that I can benefit from. Your wish shall be answered. You can prevent dangling prepositions, such as the one above, by rearranging your sentence a little. I am doing some searching and researching but I also know that this world famous group may have some insight and resources that I can benefit from. Would become: I am doing some searching and researching but I also know that this world famous group may have some insight and resources that from which I can benefit. If you want to be technical, Cummings I have been searching and researching, but I am aware that this world-famous group may be able to offer some insight and resources from which I may benefit. Doh! Typo! :) I am looking for an address validation database and API to use with our retail applications (does not have to be free). I would prefer to be able to buy data according to postal code. I will likely use AJAX to take an address that is input into the system and find a similar or better address and then offer the user the opportunity to use the returned address or the one that they put into the system. You have all seen this in operation if you use maps.google.com when it does not flat out recognize the address. Is anyone aware of anything like this that they can point me to? Similarly... Is anyone aware of anything like this that they can point me to? Would become: Is anyone aware of anything like this to which they can point me? and Is anyone aware of a similar system or database? Baby steps my friend! We don't want them to lose focus too early in their development :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Address validation API's for PHP
[snip] Someone needs to smack Robert. He's off on a tangent again. ;-P [/snip] Nope, that is normal. [snip] Honestly, me either. I've built ZIP-code-to-longitude/latitude points, but nothing with address suggestion. Jay, are you also looking for the PLUS+4 ZIP code information? Is it possible that the USPS (if you're looking for US addresses) has a free or low-cost API? [/snip] I am looking at their address matching service now and trying to determine how much it costs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[6]: [PHP] Need a more elegant way of bitwise ORing values
Hi Robert, Wednesday, June 13, 2007, 3:15:39 PM, you wrote: It's terribly verbose and inefficient... ?php $filter['flags'] = 0; if( $allow_fraction ) { $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION; } if( $allow_thousand ) { $filter['flags'] |= FILTER_FLAG_ALLOW_THOUSAND; } if( $allow_scientific ) { $filter['flags'] |= FILTER_FLAG_ALLOW_SCIENTIFIC; } ? I don't think it's *terribly* verbose, as it has good sentence structure to it, but your version is certainly more efficient, hence I've swapped to that. Any other takers? ;) Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk Never trust a computer you can't throw out of a window -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Address validation API's for PHP
On Wed, 2007-06-13 at 09:19 -0500, Jay Blanchard wrote: [snip] Someone needs to smack Robert. He's off on a tangent again. ;-P [/snip] Nope, that is normal. Just adding some light morning humour to the list :D At least... I hope it was taken as humour :^ Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On 6/13/07, Jason Pruim [EMAIL PROTECTED] wrote: On Jun 13, 2007, at 10:19 AM, Jay Blanchard wrote: [snip] Someone needs to smack Robert. He's off on a tangent again. ;-P [/snip] Nope, that is normal. [snip] Honestly, me either. I've built ZIP-code-to-longitude/latitude points, but nothing with address suggestion. Jay, are you also looking for the PLUS+4 ZIP code information? Is it possible that the USPS (if you're looking for US addresses) has a free or low-cost API? [/snip] I am looking at their address matching service now and trying to determine how much it costs Hi Jay, I actually work with the post office on my day job, we do presorted mailings with them. And I can tell you that the post office does not sell any addresses to private individuals. For the mailings we do where we need to get a list we have to go to a third party to get the list. The stuff you're looking at is probably the CASS software, or maybe Delivery Point Validation. Both of which you run on your current mailing list to make sure you qualify for the cheaper postage rates. I can also tell you that the CASS software costs about $1,000 a year for access to match your addresses against the database. :) But I don't think it really does what you are looking for. You may want to look into a third party place like InfoUSA[1] since they sell the addresses (We use them sometimes in fact) they may be able to do what you are looking for. [1] http://www.InfoUSA.com Jason: Tell them to stop raising the price of the damned stamps! Offer to take a pay cut and take one for the team I'll buy you a beer. Zoltán: Trade with me. I've been here for less than two hours and I'm ready to go home. I'll buy you a beer. Robert: I need to borrow a few bucks so that I can buy Jason and Zoltán a beer. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php / mysql performance resources
Hi everyone, Can anyone recommend any good books/resources for php and mysql performance management? I'm more interested in the software development side (as opposed to server configuration) of things. I'm looking for anything that would be good to know when working on websites that get millions of hits a day. Also, if anyone knows of any resources/discussions that illustrate the relative performance of joins vs multiple selects I'd love to check it out. Thanks, Guillaume -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[6]: [PHP] Need a more elegant way of bitwise ORing values
On Wed, 2007-06-13 at 15:19 +0100, Richard Davey wrote: Hi Robert, Wednesday, June 13, 2007, 3:15:39 PM, you wrote: It's terribly verbose and inefficient... ?php $filter['flags'] = 0; if( $allow_fraction ) { $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION; } if( $allow_thousand ) { $filter['flags'] |= FILTER_FLAG_ALLOW_THOUSAND; } if( $allow_scientific ) { $filter['flags'] |= FILTER_FLAG_ALLOW_SCIENTIFIC; } ? I don't think it's *terribly* verbose, as it has good sentence structure to it, but your version is certainly more efficient, hence I've swapped to that. Any other takers? ;) Personally I hate constants (can't use non-scalar values so why get used ot them... also they're just another point for name collision) so if it were my own code I'd do something more like the following: ?php $GLOBALS['filterFlags'] = array ( 'allowFraction' = 1 0, 'allowThousand' = 1 1, 'allowScientific' = 1 2, ); // then your above code would become: $filter['flags'] = 0; foreach( $filterFlags as $name = $bits ) { if( isset( $$name ) $$name ) { $filter['flags'] |= $bits; } } ? Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Address validation API's for PHP
2007. 06. 13, szerda keltezéssel 10.24-kor Robert Cummings ezt írta: On Wed, 2007-06-13 at 09:19 -0500, Jay Blanchard wrote: [snip] Someone needs to smack Robert. He's off on a tangent again. ;-P [/snip] Nope, that is normal. Just adding some light morning humour to the list :D At least... I hope it was taken as humour :^ by me it was taken as humour which made me feel much better than usually after a day in work ;) (okay, not a full day, there are 20 minutes left :D ) greets Zoltán Németh Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Wed, 2007-06-13 at 10:52 -0400, Daniel Brown wrote: On 6/13/07, Jason Pruim [EMAIL PROTECTED] wrote: On Jun 13, 2007, at 10:19 AM, Jay Blanchard wrote: Hi Jay, I actually work with the post office on my day job, we do presorted mailings with them. And I can tell you that the post office does not sell any addresses to private individuals. For the mailings we do where we need to get a list we have to go to a third party to get the list. The stuff you're looking at is probably the CASS software, or maybe Delivery Point Validation. Both of which you run on your current mailing list to make sure you qualify for the cheaper postage rates. I can also tell you that the CASS software costs about $1,000 a year for access to match your addresses against the database. :) But I don't think it really does what you are looking for. You may want to look into a third party place like InfoUSA[1] since they sell the addresses (We use them sometimes in fact) they may be able to do what you are looking for. [1] http://www.InfoUSA.com Jason: Tell them to stop raising the price of the damned stamps! Offer to take a pay cut and take one for the team I'll buy you a beer. Zoltán: Trade with me. I've been here for less than two hours and I'm ready to go home. I'll buy you a beer. Robert: I need to borrow a few bucks so that I can buy Jason and Zoltán a beer. Sorry Dan, but you still owe me the $20 I lent you last week for an after beer prossie :/ :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Jun 13, 2007, at 10:52 AM, Daniel Brown wrote: Hi Jay, I actually work with the post office on my day job, we do presorted mailings with them. And I can tell you that the post office does not sell any addresses to private individuals. For the mailings we do where we need to get a list we have to go to a third party to get the list. The stuff you're looking at is probably the CASS software, or maybe Delivery Point Validation. Both of which you run on your current mailing list to make sure you qualify for the cheaper postage rates. I can also tell you that the CASS software costs about $1,000 a year for access to match your addresses against the database. :) But I don't think it really does what you are looking for. You may want to look into a third party place like InfoUSA[1] since they sell the addresses (We use them sometimes in fact) they may be able to do what you are looking for. [1] http://www.InfoUSA.com Jason: Tell them to stop raising the price of the damned stamps! Offer to take a pay cut and take one for the team I'll buy you a beer. If only it was that easy... :) And actually if you want to send 200 pieces or more I can knock your postage down somewhere around 6.6¢ for the right type of mailing :) It's called work share, I do the work, they don't charge as much :) Now Where's my Beer? :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
Daniel Brown wrote: On 6/13/07, Jason Pruim [EMAIL PROTECTED] wrote: ... Jason: Tell them to stop raising the price of the damned stamps! Offer to take a pay cut and take one for the team I'll buy you a beer. Zoltán: Trade with me. I've been here for less than two hours and I'm ready to go home. I'll buy you a beer. Robert: I need to borrow a few bucks so that I can buy Jason and Zoltán a beer. I thought beer was free ;-P joke aside I never did get the 'free as in beer' argument, has nobody in the FOSS movement ever heard of a brewery cartel? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On 6/13/07, Jason Pruim [EMAIL PROTECTED] wrote: On Jun 13, 2007, at 10:52 AM, Daniel Brown wrote: Hi Jay, I actually work with the post office on my day job, we do presorted mailings with them. And I can tell you that the post office does not sell any addresses to private individuals. For the mailings we do where we need to get a list we have to go to a third party to get the list. The stuff you're looking at is probably the CASS software, or maybe Delivery Point Validation. Both of which you run on your current mailing list to make sure you qualify for the cheaper postage rates. I can also tell you that the CASS software costs about $1,000 a year for access to match your addresses against the database. :) But I don't think it really does what you are looking for. You may want to look into a third party place like InfoUSA[1] since they sell the addresses (We use them sometimes in fact) they may be able to do what you are looking for. [1] http://www.InfoUSA.com Jason: Tell them to stop raising the price of the damned stamps! Offer to take a pay cut and take one for the team I'll buy you a beer. If only it was that easy... :) And actually if you want to send 200 pieces or more I can knock your postage down somewhere around 6.6¢ for the right type of mailing :) It's called work share, I do the work, they don't charge as much :) Now Where's my Beer? :) You help me when it comes time to sending out the invitations for my wedding in the spring and you're invited --- open bar with top-shelf stuff! -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[8]: [PHP] Need a more elegant way of bitwise ORing values
On Wed, 2007-06-13 at 15:59 +0100, Richard Davey wrote: Hi Robert, Wednesday, June 13, 2007, 3:37:38 PM, you wrote: Personally I hate constants (can't use non-scalar values so why get used ot them... also they're just another point for name collision) so if it were my own code I'd do something more like the following: Sure, but the filter extension uses them, which is where they come from. They aren't of my own creation, and I cannot assume that the values assigned to them won't change in the future, so can't hardcode my way around them. That's an excellent reason to use constants :) I don't have anything against side-wide constants myself (no worse than an array shoved into $GLOBALS) but PHP seems to be moving more and more towards the use of constants within extensions as function parameters, PDO being another popular culprit that springs to mind. Yeah, I consider constants and globals to be very similar. For the most part I only use globals as site-wide configuration directives and even then I usually double nest them according to what they modify. It is quite reasonable that extensions would prefer constants over globals though since the values as far as they are concerned should be read-only. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Google Talk Integration
Hi, In the site http://www.imified.com/api/ it has a API that it makes the integration of the GTALK with any programming language. But I am not obtaining to make script php to send a message for my user in google talk. Somebody already used this api? Hermes Alves www.argohost.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
2007. 06. 13, szerda keltezéssel 10.52-kor Daniel Brown ezt írta: On 6/13/07, Jason Pruim [EMAIL PROTECTED] wrote: On Jun 13, 2007, at 10:19 AM, Jay Blanchard wrote: [snip] Someone needs to smack Robert. He's off on a tangent again. ;-P [/snip] Nope, that is normal. [snip] Honestly, me either. I've built ZIP-code-to-longitude/latitude points, but nothing with address suggestion. Jay, are you also looking for the PLUS+4 ZIP code information? Is it possible that the USPS (if you're looking for US addresses) has a free or low-cost API? [/snip] I am looking at their address matching service now and trying to determine how much it costs Hi Jay, I actually work with the post office on my day job, we do presorted mailings with them. And I can tell you that the post office does not sell any addresses to private individuals. For the mailings we do where we need to get a list we have to go to a third party to get the list. The stuff you're looking at is probably the CASS software, or maybe Delivery Point Validation. Both of which you run on your current mailing list to make sure you qualify for the cheaper postage rates. I can also tell you that the CASS software costs about $1,000 a year for access to match your addresses against the database. :) But I don't think it really does what you are looking for. You may want to look into a third party place like InfoUSA[1] since they sell the addresses (We use them sometimes in fact) they may be able to do what you are looking for. [1] http://www.InfoUSA.com Jason: Tell them to stop raising the price of the damned stamps! Offer to take a pay cut and take one for the team I'll buy you a beer. Zoltán: Trade with me. I've been here for less than two hours and I'm ready to go home. I'll buy you a beer. hmm sorry I prefer to go now and buy myself a beer since working hours is over now for me :D greets Zoltán Németh Robert: I need to borrow a few bucks so that I can buy Jason and Zoltán a beer. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Jun 13, 2007, at 10:19 AM, Jay Blanchard wrote: [snip] Someone needs to smack Robert. He's off on a tangent again. ;-P [/snip] Nope, that is normal. [snip] Honestly, me either. I've built ZIP-code-to-longitude/latitude points, but nothing with address suggestion. Jay, are you also looking for the PLUS+4 ZIP code information? Is it possible that the USPS (if you're looking for US addresses) has a free or low-cost API? [/snip] I am looking at their address matching service now and trying to determine how much it costs Hi Jay, I actually work with the post office on my day job, we do presorted mailings with them. And I can tell you that the post office does not sell any addresses to private individuals. For the mailings we do where we need to get a list we have to go to a third party to get the list. The stuff you're looking at is probably the CASS software, or maybe Delivery Point Validation. Both of which you run on your current mailing list to make sure you qualify for the cheaper postage rates. I can also tell you that the CASS software costs about $1,000 a year for access to match your addresses against the database. :) But I don't think it really does what you are looking for. You may want to look into a third party place like InfoUSA[1] since they sell the addresses (We use them sometimes in fact) they may be able to do what you are looking for. [1] http://www.InfoUSA.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[8]: [PHP] Need a more elegant way of bitwise ORing values
Hi Robert, Wednesday, June 13, 2007, 3:37:38 PM, you wrote: Personally I hate constants (can't use non-scalar values so why get used ot them... also they're just another point for name collision) so if it were my own code I'd do something more like the following: Sure, but the filter extension uses them, which is where they come from. They aren't of my own creation, and I cannot assume that the values assigned to them won't change in the future, so can't hardcode my way around them. I don't have anything against side-wide constants myself (no worse than an array shoved into $GLOBALS) but PHP seems to be moving more and more towards the use of constants within extensions as function parameters, PDO being another popular culprit that springs to mind. Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk Never trust a computer you can't throw out of a window -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php / mysql performance resources
On Wed, 2007-06-13 at 10:36 -0400, Guillaume Theoret wrote: Hi everyone, Can anyone recommend any good books/resources for php and mysql performance management? I'm more interested in the software development side (as opposed to server configuration) of things. I'm looking for anything that would be good to know when working on websites that get millions of hits a day. Also, if anyone knows of any resources/discussions that illustrate the relative performance of joins vs multiple selects I'd love to check it out. JOIN will almost always be faster by virtue of the query being optimized and doing the work within a single request. JOIN couples two table together. JOIN simplifies the data retrieval and code. MULTIPLE SELECTS allows you to join the data yourself, possibly almost as fast as the database. MULTIPLE SELECTS allows the tables to reside in different locations. MULTIPLE SELECTS can be faster than a JOIN if your database is under heavy load and you place the tables on different servers allowing the PHP process to do the joining work. PHP processes scale horizontally better than database servers. MULTIPLE SELECTS are usually add complexity to your code. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Wed, 2007-06-13 at 17:16 +0200, Zoltán Németh wrote: 2007. 06. 13, szerda keltezéssel 10.52-kor Daniel Brown ezt írta: On 6/13/07, Jason Pruim [EMAIL PROTECTED] wrote: Jason: Tell them to stop raising the price of the damned stamps! Offer to take a pay cut and take one for the team I'll buy you a beer. Zoltán: Trade with me. I've been here for less than two hours and I'm ready to go home. I'll buy you a beer. hmm sorry I prefer to go now and buy myself a beer since working hours is over now for me :D I work from home... the beer is in the fridge :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Jun 13, 2007, at 11:10 AM, Daniel Brown wrote: On 6/13/07, Jason Pruim [EMAIL PROTECTED] wrote: On Jun 13, 2007, at 10:52 AM, Daniel Brown wrote: Hi Jay, I actually work with the post office on my day job, we do presorted mailings with them. And I can tell you that the post office does not sell any addresses to private individuals. For the mailings we do where we need to get a list we have to go to a third party to get the list. The stuff you're looking at is probably the CASS software, or maybe Delivery Point Validation. Both of which you run on your current mailing list to make sure you qualify for the cheaper postage rates. I can also tell you that the CASS software costs about $1,000 a year for access to match your addresses against the database. :) But I don't think it really does what you are looking for. You may want to look into a third party place like InfoUSA[1] since they sell the addresses (We use them sometimes in fact) they may be able to do what you are looking for. [1] http://www.InfoUSA.com Jason: Tell them to stop raising the price of the damned stamps! Offer to take a pay cut and take one for the team I'll buy you a beer. If only it was that easy... :) And actually if you want to send 200 pieces or more I can knock your postage down somewhere around 6.6¢ for the right type of mailing :) It's called work share, I do the work, they don't charge as much :) Now Where's my Beer? :) You help me when it comes time to sending out the invitations for my wedding in the spring and you're invited --- open bar with top-shelf stuff! You get over 200 and we can definitely work something out, as long as your pride is okay with doing a presorted mailing (Mine wasn't) I can guarantee that all the pieces will get there. And get there quickly too. How does an average of about 34.1¢/piece sound as long as you stay under an ounce? :) -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is this code thread safe?
I'm pretty sure this code is thread safe, but I just want to be 100% sure. I have a class called ViewHelper with a static function called is_signed_in. All it does is check the session for the existence of a particular variable, and if it's there, it returns true, otherwise false. Since the function is static, is there any way this code is not thread safe? Is there any way I could be checking someone else's session if the requests are concurrent? Thanks, Christian
Re: [PHP] Address validation API's for PHP
On 6/13/07, Jason Pruim [EMAIL PROTECTED] wrote: On Jun 13, 2007, at 11:10 AM, Daniel Brown wrote: On 6/13/07, Jason Pruim [EMAIL PROTECTED] wrote: On Jun 13, 2007, at 10:52 AM, Daniel Brown wrote: Hi Jay, I actually work with the post office on my day job, we do presorted mailings with them. And I can tell you that the post office does not sell any addresses to private individuals. For the mailings we do where we need to get a list we have to go to a third party to get the list. The stuff you're looking at is probably the CASS software, or maybe Delivery Point Validation. Both of which you run on your current mailing list to make sure you qualify for the cheaper postage rates. I can also tell you that the CASS software costs about $1,000 a year for access to match your addresses against the database. :) But I don't think it really does what you are looking for. You may want to look into a third party place like InfoUSA[1] since they sell the addresses (We use them sometimes in fact) they may be able to do what you are looking for. [1] http://www.InfoUSA.com Jason: Tell them to stop raising the price of the damned stamps! Offer to take a pay cut and take one for the team I'll buy you a beer. If only it was that easy... :) And actually if you want to send 200 pieces or more I can knock your postage down somewhere around 6.6¢ for the right type of mailing :) It's called work share, I do the work, they don't charge as much :) Now Where's my Beer? :) You help me when it comes time to sending out the invitations for my wedding in the spring and you're invited --- open bar with top-shelf stuff! You get over 200 and we can definitely work something out, as long as your pride is okay with doing a presorted mailing (Mine wasn't) I can guarantee that all the pieces will get there. And get there quickly too. How does an average of about 34.1¢/piece sound as long as you stay under an ounce? :) -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Well, we won't be sending until February or so, at the earliest, but it sounds good to me. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On 6/13/07, Daniel Brown [EMAIL PROTECTED] wrote: On 6/13/07, Jason Pruim [EMAIL PROTECTED] wrote: On Jun 13, 2007, at 11:10 AM, Daniel Brown wrote: On 6/13/07, Jason Pruim [EMAIL PROTECTED] wrote: On Jun 13, 2007, at 10:52 AM, Daniel Brown wrote: Hi Jay, I actually work with the post office on my day job, we do presorted mailings with them. And I can tell you that the post office does not sell any addresses to private individuals. For the mailings we do where we need to get a list we have to go to a third party to get the list. The stuff you're looking at is probably the CASS software, or maybe Delivery Point Validation. Both of which you run on your current mailing list to make sure you qualify for the cheaper postage rates. I can also tell you that the CASS software costs about $1,000 a year for access to match your addresses against the database. :) But I don't think it really does what you are looking for. You may want to look into a third party place like InfoUSA[1] since they sell the addresses (We use them sometimes in fact) they may be able to do what you are looking for. [1] http://www.InfoUSA.com Jason: Tell them to stop raising the price of the damned stamps! Offer to take a pay cut and take one for the team I'll buy you a beer. If only it was that easy... :) And actually if you want to send 200 pieces or more I can knock your postage down somewhere around 6.6¢ for the right type of mailing :) It's called work share, I do the work, they don't charge as much :) Now Where's my Beer? :) You help me when it comes time to sending out the invitations for my wedding in the spring and you're invited --- open bar with top-shelf stuff! You get over 200 and we can definitely work something out, as long as your pride is okay with doing a presorted mailing (Mine wasn't) I can guarantee that all the pieces will get there. And get there quickly too. How does an average of about 34.1¢/piece sound as long as you stay under an ounce? :) -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Well, we won't be sending until February or so, at the earliest, but it sounds good to me. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Oh, and Zoltán and Robert --- just wanted you guys to know that I hate you both. I miss the days of working from home, too -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this code thread safe?
On 6/13/07, Christian Cantrell [EMAIL PROTECTED] wrote: I'm pretty sure this code is thread safe, but I just want to be 100% sure. I have a class called ViewHelper with a static function called is_signed_in. All it does is check the session for the existence of a particular variable, and if it's there, it returns true, otherwise false. Since the function is static, is there any way this code is not thread safe? Is there any way I could be checking someone else's session if the requests are concurrent? Thanks, Christian That should be perfectly alright, as each thread should have its own SESSID. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Wed, 2007-06-13 at 11:58 -0400, Daniel Brown wrote: Oh, and Zoltán and Robert --- just wanted you guys to know that I hate you both. I miss the days of working from home, too Drown your sorrows in beer... oh wait!! *teehee* ;) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirecting to a parent page
On Wed, June 13, 2007 11:12 pm, Yamil Ortega wrote: Lets say that I have the next structure on my web directory /file1.php /procces/file2.php /file3.php So, when I see the file1.php on the browser I see the page in this route http://localhost/apache2/file1.php I have a button that sends information to the /process/file2.php. When the process is finished, I have to come back to the parent directory page. Im using this instruction header( refresh:'3'; url=./file3.php); You need a COMPLETE url here, not just relative pathname, almost for sure. But I got the error that in http://localhost/file3.php does not exists any page If I use this header( refresh:'3'; url=file3.php); I got the error that in http://localchost/procces/file3.php does not exists So, how can I redirect the file2.php to the file3.php in the parent directory? You also should consider just doing: include('file3.php'); instead of bouncing the user back-and-forth between the server/client in slow HTTP connnections... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dom appendChild strips trailing text from within a node
I am trying to modify a node name and it mostly works, except that appendChild seems to strip the text that FOLLOWS after a subnode. Leading text and subnodes appear to be retained perfectly, just not text trailing the subnode. I tried using cloneNode, but that discarded the children even when I sent true as an argument. $html='divdiv1 bbold1 iitalic1uunderline1/u/i bold2/b div2bbold3/b uunderline/u/div'; $dom = new DomDocument; $dom-loadHTML($html); $nodes = $dom-getElementsByTagName('b'); foreach ($nodes as $oldNode) { $newNode = $dom-createElement('strong'); foreach($oldNode-childNodes as $thisOldNode) { if ($thisOldNode-nodeName == '#text') { $newNode-nodeValue .= $thisOldNode-nodeValue; } else { // appendChild seems to cause the issue // $newNode-appendChild($thisOldNode); } } $oldNode-parentNode-replaceChild($newNode, $oldNode); } //for debugging: echo nl2br(htmlentities($html)) . 'hr /'; echo nl2br(htmlentities(str_replace(array('body', '/body', '/html'), '', strstr($dom-saveXML(), 'body'; /* Should return: divdiv1 strongbold1 iitalic1uunderline1/u/i bold2/strong div2bbold3/b uunderline/u/div Instead returns: divdiv1 strongbold1 iitalic1uunderline1/u/i/strong div2bbold3/b uunderline/u/div */
[PHP] create file permission problem
Hi Gang: I'm sure this is obvious to most, but not to me. I working on a virtual host. If I want to save data in a file, I can ftpconnect(); change the permissions of an existing file from 0755 to 0777; write to the file; and change the permissions of the file back to 0755 -- no problem. However, if a file is not there, then I can create one. However, the permissions of the file will be automagically set to 0600 and as such, I can't change them via ftpconnect(). In other words, I can't FTP in to my site and change the permissions of a file I created. I can delete the file, but that's all. How do you guys create a file and set its permissions working on a virtual host via php? Cheers, tedd PS: If I remember correctly, it was pretty easy in perl. Just try to open/write a file and if it wasn't there, it created one for you. But, it's been years since I did any perl stuff -- could be wrong. -- --- 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
Re: [PHP] Is this code thread safe?
On Wed, June 13, 2007 10:52 am, Christian Cantrell wrote: I'm pretty sure this code is thread safe, but I just want to be 100% sure. I have a class called ViewHelper with a static function called is_signed_in. All it does is check the session for the existence of a particular variable, and if it's there, it returns true, otherwise false. Since the function is static, is there any way this code is not thread safe? Is there any way I could be checking someone else's session if the requests are concurrent? Well, I'm not sure how your ViewHelper could possibly screw things up, but the $_SESSION variable is already thread-safe, unless you've hacked up a custom session handler that isn't thread-safe... In which case you've got bigger problems than just this one function. :-v $_SESSION gets a lock on the session data file at session_start which is not released until session_*close So instead off all that OOP stuff, if you just did: if (isset($_SESSION['is_logged_in'])){ } and used unset($_SESSION['is_logged_in']) to log somebody out, well, you'd pretty much have the same functionality in a lot less lines of code... But, hey, I'm sure the ViewHelper has a lot of other Added Value, right? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php / mysql performance resources
Thanks for the response. On 6/13/07, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2007-06-13 at 10:36 -0400, Guillaume Theoret wrote: Hi everyone, Can anyone recommend any good books/resources for php and mysql performance management? I'm more interested in the software development side (as opposed to server configuration) of things. I'm looking for anything that would be good to know when working on websites that get millions of hits a day. Also, if anyone knows of any resources/discussions that illustrate the relative performance of joins vs multiple selects I'd love to check it out. JOIN will almost always be faster by virtue of the query being optimized and doing the work within a single request. Really? I thought the way it worked was that when you joined 2 tables it needed to create every row combination applicable and then apply the where clause. In large tables wouldn't this be slower? It's these kinds of optimizations and when the kick in, etc that I don't know much about. In our application we wrote an abstraction layer with lazy loading. (eg: If a User has a Profile the db users table has a profile_id and we create a ProxyProfile that only has an id and will look up its other attributes in the db if ever needed and then replace its reference by a full Profile object.) Because of this, so far the entire app only has 1 join because the other select(s) will only be done if and when they're needed. I'm certain this is faster in the average case but I wanted to know which is generally faster in case I later profile the code and see that in some cases the dependent item is pretty much always loaded. JOIN couples two table together. JOIN simplifies the data retrieval and code. MULTIPLE SELECTS allows you to join the data yourself, possibly almost as fast as the database. MULTIPLE SELECTS allows the tables to reside in different locations. MULTIPLE SELECTS can be faster than a JOIN if your database is under heavy load and you place the tables on different servers allowing the PHP process to do the joining work. PHP processes scale horizontally better than database servers. The db will be under heavy load (once we deploy) but we don't yet intend on distributing the database. We did however plan for it since in the scenario I described above we just need to create a different db connection for a different table. We could theoretically have as many different db servers as tables (except for that one join of 2 tables). MULTIPLE SELECTS are usually add complexity to your code. We dealt with this in our design.. The actual front-end functionality is all simply object-oriented programming so I can muck around as much as I want with the ORM layer without affecting any of anyone else's code. (As long as I don't change the published interface of course!) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IF with multiple values for a variable
Okay, I know this has got to be easy but it's not working any way I try it. When a record is selected it opens up a new page. My query will display the specific results based on the type of record selected. There can be multiple values in each if. However I am having a brain fart in my if statement assigning the multiple values. Here is my if statement: if ($type == 'T','D','L' { $get_id.= payment_request WHERE id = '$payment_id'; } However this does not return ant results. I've tried if ($type = array('T','D','L'), if ($type == array('T','D','L'), if ($type == 'T,D,L'), if ($type == 'T' or 'D' or 'L' I also looked in the PHP manual for examples of if's and didn't find any help. I can get it to work if I create a seperate if statement for each type condition but i would prefer to not duplicate my code just to add a seperate $type
RE: Re[6]: [PHP] Need a more elegant way of bitwise ORing values
From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: Wed 13/06/2007 15:19 To: PHP List Hi Robert, Wednesday, June 13, 2007, 3:15:39 PM, you wrote: It's terribly verbose and inefficient... ?php $filter['flags'] = 0; if( $allow_fraction ) { $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION; } if( $allow_thousand ) { $filter['flags'] |= FILTER_FLAG_ALLOW_THOUSAND; } if( $allow_scientific ) { $filter['flags'] |= FILTER_FLAG_ALLOW_SCIENTIFIC; } ? I don't think it's *terribly* verbose, as it has good sentence structure to it, but your version is certainly more efficient, hence I've swapped to that. Any other takers? ;) Well, I don't know about more efficient but I'd be terribly tempted to express it like this: $filter['flags'] = $allow_fraction ? FILTER_FLAG_ALLOW_FRACTION : 0 | $allow_thousand ? FILTER_FLAG_ALLOW_THOUSAND : 0 | $allow_scientific ? FILTER_FLAG_ALLOW_SCIENTIFIC : 0; Whether you think this is more readable and/or less verbose probably depends on personal taste! ;) - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 812 4730 Fax: +44 113 812 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
Re: [PHP] create file permission problem
On 6/13/07, tedd [EMAIL PROTECTED] wrote: Hi Gang: I'm sure this is obvious to most, but not to me. I working on a virtual host. If I want to save data in a file, I can ftpconnect(); change the permissions of an existing file from 0755 to 0777; write to the file; and change the permissions of the file back to 0755 -- no problem. However, if a file is not there, then I can create one. However, the permissions of the file will be automagically set to 0600 and as such, I can't change them via ftpconnect(). In other words, I can't FTP in to my site and change the permissions of a file I created. I can delete the file, but that's all. How do you guys create a file and set its permissions working on a virtual host via php? Cheers, tedd PS: If I remember correctly, it was pretty easy in perl. Just try to open/write a file and if it wasn't there, it created one for you. But, it's been years since I did any perl stuff -- could be wrong. -- --- 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 Two quick questions Is the PHP script running ftpconnect() using a valid FTP account with privileges to own/share a file on the system? How are you creating the file on the FTP server? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php / mysql performance resources
On Wed, June 13, 2007 10:17 am, Robert Cummings wrote: On Wed, 2007-06-13 at 10:36 -0400, Guillaume Theoret wrote: Hi everyone, Can anyone recommend any good books/resources for php and mysql performance management? I'm more interested in the software development side (as opposed to server configuration) of things. I'm looking for anything that would be good to know when working on websites that get millions of hits a day. Also, if anyone knows of any resources/discussions that illustrate the relative performance of joins vs multiple selects I'd love to check it out. JOIN will almost always be faster by virtue of the query being optimized and doing the work within a single request. In my limited experience, under shared server with seriously constrained resources, the exact opposite is true... Oh, sure, for a SMALL table and an easy JOIN on straight-forward indexed fields, the JOIN is faster. But every time I've ended up with a large table and a JOIN that was anything remotely interesting (read: complex and un-indexable) the server just gets swamped. And often, a simple straight-forward select to get a handful of rows followed by another query, or even one query per result row, was MUCH faster. It's entirely possible that I just don't know SQL well enough to get the schema and indexing right, but I try to index the obvious fields that will be used in the join. This also may not even be applicable to a site that scales up with the kinds of resources you'd throw at that. But I'd certainly recommend writing small simple crude test code with a dedicated testing server and simulated real life load conditions rather than just guessing at what might be fastest. An hour's testing could save you weeks/months of development in this case. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IF with multiple values for a variable
On 6/13/07, Dan Shirah [EMAIL PROTECTED] wrote: Okay, I know this has got to be easy but it's not working any way I try it. When a record is selected it opens up a new page. My query will display the specific results based on the type of record selected. There can be multiple values in each if. However I am having a brain fart in my if statement assigning the multiple values. Here is my if statement: if ($type == 'T','D','L' { $get_id.= payment_request WHERE id = '$payment_id'; } However this does not return ant results. I've tried if ($type = array('T','D','L'), if ($type == array('T','D','L'), if ($type == 'T,D,L'), if ($type == 'T' or 'D' or 'L' I also looked in the PHP manual for examples of if's and didn't find any help. I can get it to work if I create a seperate if statement for each type condition but i would prefer to not duplicate my code just to add a seperate $type Dan, Are you trying to do this? ? if ($type == 'T' || $type == 'D' || $type == 'L') { $get_id.= payment_request WHERE id = '$payment_id'; } ? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Persistent MySQL Connection
On Wed, June 13, 2007 8:53 am, PHP Mailing List wrote: I currently running my php as cgi as it is more controllable in shared hosting, the drawback is I cannot use mysql persistent connection so mysql_pconnect() function is not an option. Is there any mysql connection pool product for php running as cgi ? The MySQL list could probably recommend several MySQL connection pooling software packages, with PHP/cgi being largely irrelevant to the question... It's incredibly unlikely that your shared hosting server will actually install any of them, mind you... Persistent connections is probably not the road you should be on in the first place. How long are your connections taking? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IF with multiple values for a variable
Excellent! Double pipes to seperate possible multiple variable values. lock in memory Thanks Daniel! On 6/13/07, Daniel Brown [EMAIL PROTECTED] wrote: On 6/13/07, Dan Shirah [EMAIL PROTECTED] wrote: Okay, I know this has got to be easy but it's not working any way I try it. When a record is selected it opens up a new page. My query will display the specific results based on the type of record selected. There can be multiple values in each if. However I am having a brain fart in my if statement assigning the multiple values. Here is my if statement: if ($type == 'T','D','L' { $get_id.= payment_request WHERE id = '$payment_id'; } However this does not return ant results. I've tried if ($type = array('T','D','L'), if ($type == array('T','D','L'), if ($type == 'T,D,L'), if ($type == 'T' or 'D' or 'L' I also looked in the PHP manual for examples of if's and didn't find any help. I can get it to work if I create a seperate if statement for each type condition but i would prefer to not duplicate my code just to add a seperate $type Dan, Are you trying to do this? ? if ($type == 'T' || $type == 'D' || $type == 'L') { $get_id.= payment_request WHERE id = '$payment_id'; } ? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107
Re: [PHP] create file permission problem
On Wed, 2007-06-13 at 13:13 -0400, tedd wrote: Hi Gang: I'm sure this is obvious to most, but not to me. I working on a virtual host. If I want to save data in a file, I can ftpconnect(); change the permissions of an existing file from 0755 to 0777; write to the file; and change the permissions of the file back to 0755 -- no problem. However, if a file is not there, then I can create one. However, the permissions of the file will be automagically set to 0600 and as such, I can't change them via ftpconnect(). In other words, I can't FTP in to my site and change the permissions of a file I created. I can delete the file, but that's all. How do you guys create a file and set its permissions working on a virtual host via php? See the following functions: http://ca.php.net/manual/en/function.umask.php http://ca.php.net/manual/en/function.chmod.php Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php / mysql performance resources
On Wed, 2007-06-13 at 13:31 -0400, Guillaume Theoret wrote: Thanks for the response. On 6/13/07, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2007-06-13 at 10:36 -0400, Guillaume Theoret wrote: Hi everyone, Can anyone recommend any good books/resources for php and mysql performance management? I'm more interested in the software development side (as opposed to server configuration) of things. I'm looking for anything that would be good to know when working on websites that get millions of hits a day. Also, if anyone knows of any resources/discussions that illustrate the relative performance of joins vs multiple selects I'd love to check it out. JOIN will almost always be faster by virtue of the query being optimized and doing the work within a single request. Really? I thought the way it worked was that when you joined 2 tables it needed to create every row combination applicable and then apply the where clause. In large tables wouldn't this be slower? It's these kinds of optimizations and when the kick in, etc that I don't know much about. That depends on the kind of join done. Generally speaking if you use the proper type of join for your needs then the DB should be faster at joining. For instance most of my joins are LEFT joins. In our application we wrote an abstraction layer with lazy loading. (eg: If a User has a Profile the db users table has a profile_id and we create a ProxyProfile that only has an id and will look up its other attributes in the db if ever needed and then replace its reference by a full Profile object.) Because of this, so far the entire app only has 1 join because the other select(s) will only be done if and when they're needed. I'm certain this is faster in the average case but I wanted to know which is generally faster in case I later profile the code and see that in some cases the dependent item is pretty much always loaded. For your example this sounds like the way to go. Needlessly joining data you don't need is a waste of resources. It's best to join the data only when you actually need the extra information pulled in from the additional table(s). Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a more elegant way of bitwise ORing values
On Wed, June 13, 2007 8:13 am, Richard Davey wrote: Hi all, Can anyone think of a more elegant way of achieving the following? ?php $flags = array(); $flags = 0; if ($allow_fraction) //Should we warn you that $allow_fraction is not actually defined?... //You don't have register_globals on, do you? { $flags[] = FILTER_FLAG_ALLOW_FRACTION; $flags |= FILTER_FLAG_ALLOW_FRACTION; if (count($flags) 0) if ($flags 0){ { $c = '$c = ' . implode('|', $flags) . ';'; eval($c); $filter['flags'] = $c; $filter = $flags; // :-) } ? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Calendar
Is there a decent free calendar? I just need to show a few events on a calendar. -- I am not a diabetic, I have diabetes my blog - http://grumpee.instantspot.com/blog -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IF with multiple values for a variable
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' record type break; case 'D': // Output 'D' record type break; case 'L': // Output 'L' record type break; default: break; } switch works really well when you have multiple if scenarios and don't want to keep doing a ton of if.. elseif... elseif...elseif... for simple comparisons. You can even use it for more complicated comparisons: switch (true) { case $type == 'T': break; case $type == 'D' and $flavor 'grape': break; default; break; } the default section is what's processed if no critera are met. Also, if you want to use the same criteria for multiple conditions, or slight variations, you can do that by removing 'break' codes: switch ($type) { case 'T': case 'D': // Do something if $type is either T or D break; case 'L': // Do something L specific case 'R': // Do something if $type is L or R (passes through from L condition because break was removed) break; default: break; } More reading here: http://us.php.net/switch Hope that helps. -TG = = = Original message = = = Okay, I know this has got to be easy but it's not working any way I try it. When a record is selected it opens up a new page. My query will display the specific results based on the type of record selected. There can be multiple values in each if. However I am having a brain fart in my if statement assigning the multiple values. Here is my if statement: if ($type == 'T','D','L' $get_id.= payment_request WHERE id = '$payment_id'; However this does not return ant results. I've tried if ($type = array('T','D','L'), if ($type == array('T','D','L'), if ($type == 'T,D,L'), if ($type == 'T' or 'D' or 'L' I also looked in the PHP manual for examples of if's and didn't find any help. I can get it to work if I create a seperate if statement for each type condition but i would prefer to not duplicate my code just to add a seperate $type ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Wed, June 13, 2007 7:45 am, Jay Blanchard wrote: I am doing some searching and researching but I also know that this world famous group may have some insight and resources that I can benefit from. I am looking for an address validation database and API to use with our retail applications (does not have to be free). I would prefer to be able to buy data according to postal code. I will likely use AJAX to take an address that is input into the system and find a similar or better address and then offer the user the opportunity to use the returned address or the one that they put into the system. You have all seen this in operation if you use maps.google.com when it does not flat out recognize the address. Is anyone aware of anything like this that they can point me to? Thanks very much in advance. Both maps.google.com and Yahoo! Maps allow you do use their internal address lookup functionality, just like they do it, and it returns a suggested address as well as how sure they are of the result (sort of) by the answer being graded at levesl like country state city etc. Naturally, they both use different coding schemes, and you have to be careful about what you use as input. But if you're looking to mimic the functionality of Google maps, you should use Google maps API to mimic the functionality of Google maps. :-) Google Maps is free under certain conditions, and costs $10K/year under other conditions. Yahoo! Maps hasn't announced pricing yet (afaik) and reserves the right to slap advertisements into a map, as I recall. (Or maybe it was Google that reserved the right to advertise?) At any rate, between the two of them, you should be able to get this done for free for the forseeable future. PS If Google and/or Yahoo! don't get the address right, I'd be pretty surprised if any other software does it any better Though I guess there are geo-spatial mailing lists that could advise you better on that part. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php / mysql performance resources
On Wed, 2007-06-13 at 12:39 -0500, Richard Lynch wrote: On Wed, June 13, 2007 10:17 am, Robert Cummings wrote: On Wed, 2007-06-13 at 10:36 -0400, Guillaume Theoret wrote: Hi everyone, Can anyone recommend any good books/resources for php and mysql performance management? I'm more interested in the software development side (as opposed to server configuration) of things. I'm looking for anything that would be good to know when working on websites that get millions of hits a day. Also, if anyone knows of any resources/discussions that illustrate the relative performance of joins vs multiple selects I'd love to check it out. JOIN will almost always be faster by virtue of the query being optimized and doing the work within a single request. In my limited experience, under shared server with seriously constrained resources, the exact opposite is true... Oh, sure, for a SMALL table and an easy JOIN on straight-forward indexed fields, the JOIN is faster. But every time I've ended up with a large table and a JOIN that was anything remotely interesting (read: complex and un-indexable) the server just gets swamped. And often, a simple straight-forward select to get a handful of rows followed by another query, or even one query per result row, was MUCH faster. It's entirely possible that I just don't know SQL well enough to get the schema and indexing right, but I try to index the obvious fields that will be used in the join. Maybe your query is poorly formed. Generally speaking anything that you need to search upon should be indexed provided it has a high enough cardinality. As such a query will usually be optimized to retrieve data using the indexed fields. If the fields aren't indexed then even a second query to retrieve the complimentary data set will still be required to do an exhaustive search without the benefit of indexing. This also may not even be applicable to a site that scales up with the kinds of resources you'd throw at that. Hence the reason I mentioned that using multiple selects is more horizontally scalable :) But I'd certainly recommend writing small simple crude test code with a dedicated testing server and simulated real life load conditions rather than just guessing at what might be fastest. An hour's testing could save you weeks/months of development in this case. For certain, if you expect such a large load it's in your interest to determine what will be the most resource and cost effective approach. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IF with multiple values for a variable
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. lock in memory Thanks Daniel! On 6/13/07, Daniel Brown [EMAIL PROTECTED] wrote: On 6/13/07, Dan Shirah [EMAIL PROTECTED] wrote: Okay, I know this has got to be easy but it's not working any way I try it. When a record is selected it opens up a new page. My query will display the specific results based on the type of record selected. There can be multiple values in each if. However I am having a brain fart in my if statement assigning the multiple values. Here is my if statement: if ($type == 'T','D','L' $get_id.= payment_request WHERE id = '$payment_id'; However this does not return ant results. I've tried if ($type = array('T','D','L'), if ($type == array('T','D','L'), if ($type == 'T,D,L'), if ($type == 'T' or 'D' or 'L' I also looked in the PHP manual for examples of if's and didn't find any help. I can get it to work if I create a seperate if statement for each type condition but i would prefer to not duplicate my code just to add a seperate $type Dan, Are you trying to do this? ? if ($type == 'T' || $type == 'D' || $type == 'L') $get_id.= payment_request WHERE id = '$payment_id'; ? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sending mail from localhost
On Wed, June 13, 2007 8:51 am, Daniel Brown wrote: $from = [EMAIL PROTECTED]; //$reply_to = [EMAIL PROTECTED]; // Same address, so not needed. Some spam filters and some email clients will behave rather badly if you don't have Reply-to: as well. Use it. $headers .= X-Mailer: PHP.phpversion().\r\n; // Headers ALWAYS need \r\n The last header does not NEED \r\n because PHP is going to trim that off and put \r\n\r\n between headers and body anyway. But it's good practice to put it in there so that when you add yet another header, you don't mistakenly leave it out where it is needed. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Wed, June 13, 2007 9:13 am, Daniel Brown wrote: Jay, are you also looking for the PLUS+4 ZIP code information? Is it possible that the USPS (if you're looking for US addresses) has a free or low-cost API? Last I checked, USPS was anything but low-cost. Plus, they only work for US, afaik, and it is the WORLD wide web... :-) PS As a Chicago resident I'm a bit biased against the USPS. :-v Chicago USPS is very consistent. Consistenly worst in the nation. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Wed, June 13, 2007 9:52 am, Daniel Brown wrote: Jason: Tell them to stop raising the price of the damned stamps! Offer to take a pay cut and take one for the team I'll buy you a beer. Or, better yet, raise it as high as they want, but STOP DELIVERING THE JUNK MAIL so you can actually handle the volume and get me my REAL mail, instead of leaving it scattered all over the friggin' city in somebody else's mailbox! [Sorry, Jason] -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: create file permission problem
Doesn't ftp_chmod() work immediately after creating your file, while the resource is still open? Check the permissions for the directory. Check the file and dir permissions with your ftp utility [e.g., WinSCP]. Or, write a simple script that echoes them. It really should work, I do it frequently. tedd wrote: Hi Gang: I'm sure this is obvious to most, but not to me. I working on a virtual host. If I want to save data in a file, I can ftpconnect(); change the permissions of an existing file from 0755 to 0777; write to the file; and change the permissions of the file back to 0755 -- no problem. However, if a file is not there, then I can create one. However, the permissions of the file will be automagically set to 0600 and as such, I can't change them via ftpconnect(). In other words, I can't FTP in to my site and change the permissions of a file I created. I can delete the file, but that's all. How do you guys create a file and set its permissions working on a virtual host via php? Cheers, tedd PS: If I remember correctly, it was pretty easy in perl. Just try to open/write a file and if it wasn't there, it created one for you. But, it's been years since I did any perl stuff -- could be wrong. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On Wed, June 13, 2007 10:07 am, Jochem Maas wrote: I thought beer was free ;-P joke aside I never did get the 'free as in beer' argument, has nobody in the FOSS movement ever heard of a brewery cartel? http://en.wikipedia.org/wiki/Free_as_in_beer I get all my beer for free. Well, not really free. Ya build a website for a bar, and take your pay in beer. S. Don't tell the IRS! -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sending mail from localhost
On 6/13/07, Richard Lynch [EMAIL PROTECTED] wrote: On Wed, June 13, 2007 8:51 am, Daniel Brown wrote: $from = [EMAIL PROTECTED]; //$reply_to = [EMAIL PROTECTED]; // Same address, so not needed. Some spam filters and some email clients will behave rather badly if you don't have Reply-to: as well. Use it. $headers .= X-Mailer: PHP.phpversion().\r\n; // Headers ALWAYS need \r\n The last header does not NEED \r\n because PHP is going to trim that off and put \r\n\r\n between headers and body anyway. But it's good practice to put it in there so that when you add yet another header, you don't mistakenly leave it out where it is needed. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? Is that a fact, Richard? It was always my understanding that the raw connection to the SMTP server initiated by the PHP mail() functions and Sendmail required the \r\n separator for every field other than SUBJECT (included in the DATA part of the message body). And it's my opinion, of course, but any SPAM filter that would require a reply-to header is done in bad form. It should certainly require X-Mailer, but what good is a spoof-able reply-to header if the from header is already in place, real or unreal? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Calendar
Is there a decent free calendar? I just need to show a few events on a calendar. You could try your bank. They usually have free calendars, coffee mugs, pencils, etc. ;-) Seriously though, type 'php calendar' into google and see what happens. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address validation API's for PHP
On 6/13/07, Richard Lynch [EMAIL PROTECTED] wrote: On Wed, June 13, 2007 10:07 am, Jochem Maas wrote: I thought beer was free ;-P joke aside I never did get the 'free as in beer' argument, has nobody in the FOSS movement ever heard of a brewery cartel? http://en.wikipedia.org/wiki/Free_as_in_beer I get all my beer for free. Well, not really free. Ya build a website for a bar, and take your pay in beer. S. Don't tell the IRS! -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? If I were to do that for the bars in this area, northeast Pennsylvania residents would swear we were under prohibition again as each bar in turn went out of business. Coincidentally, I will need to put an addition on my house this fall to accommodate the growth of my liver. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP list as a blog
On Tue, June 12, 2007 11:39 pm, Paul Scott wrote: BTW, could I get your opinions on the blog software itself? This is running a CVS checkout of the Chisimba framework with the blog module installed. It's a blog. People type things. They show up, more or less in some kind of order. ... I don't think I'm the right guy to evaluate it, as I blog so rarely... I am currently averaging 2 posts per year, roughly, including today's rant about header(Location:): http://richardlynchblogspot.com :-) PS Regular readers of this list need not visit -- You've heard it all before from me here. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP list as a blog
On Wed, June 13, 2007 12:21 am, Crayon Shin Chan wrote: On Wednesday 13 June 2007 12:39, Paul Scott wrote: Our interns and students specifically. They are all dead scared of joining mailing lists in general, and find that using a web based prettier interface is much easier and friendlier. Not to mention slower, clumsier and more bandwidth hungry than a mailing list. It's time you did them a favour and show them that mailing lists are nothing to be afraid of. Do students and interns still have quotas on their email accounts?... Cuz I *DO* remember the days when the email quotas a University would have prohibited subscribing to PHP mailing list... Surely in this day and age, the quotas aren't *that* restrictive... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP list as a blog
On Wed, June 13, 2007 12:29 am, Paul Scott wrote: This was done as well to give my blog code a bit of a test drive as well, I had no idea how it would perform with lots of posts too, so I will also be able to optimize queries etc as the posts fill up. Oh, we'll fill that sucker up pretty fast... :-) -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IF with multiple values for a variable
On Wed, 2007-06-13 at 13:57 -0400, [EMAIL PROTECTED] wrote: 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 They aren't exactly the same. Make sure and read the order of precedence note. The following, for example, are not equivalent: ?php $true = true; $false = false; $test1 = $true $false; $test2 = $true and $false; ? Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Calendar
I did that and either they are not free or suck... dont appreciate the comment On 6/13/07, Jim Moseby [EMAIL PROTECTED] wrote: Is there a decent free calendar? I just need to show a few events on a calendar. You could try your bank. They usually have free calendars, coffee mugs, pencils, etc. ;-) Seriously though, type 'php calendar' into google and see what happens. 1) Please don't top-post. 2) Please include the list in your replies. 3) Please search dictionary.com for 'humor', and learn to recognize it. hint: A winkie ';-)' is a clue! You will likely get a more useful response from the list members if you include enough information. For instance, what do you mean by 'decent'? (One man's 'decent' is another man's 'sucks') What do you mean by 'calendar'? Do you mean a full-blown scheduling system, or do you just want to display a one month calendar? Do you need a database back end, or will the content be static? What is the problem you are trying to solve? etc... Just trying to help. JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Going from simple to super CAPTCHA
On Tue, June 12, 2007 10:12 pm, Jake McHenry wrote: Has anyone tried cracking/hacking what Microsoft has done with the animal pictures? MS is using petfinder.com or whatever it is, as their source to know what is a cat and a dog So all you have to do is trick petfinder.com into giving you all the cat and dog pictures, and store those (or their MD5). You then can get the MS image, look it up in your db, and you've cracked their system. This does not seem like it would be terribly difficult, even with the number of cats/dogs on the site. have the answer? Other than the completely blind, anyone can tell what a cat is, and they could even take it further by added a bark or meow or something I've seen an awful lot of bad pictures (or even live animals) where telling if it was a cat or a dog was pretty hard at first... similar. Can a computer tell the difference between a bark and a meow? Each animal has its unique vocal tones and cry signature... just as a human (who's not impersonating, which as long as its not a picture of the mocking bird...), does this help at all? Instead of relying on our own known dictionary and numbers Everyone knows about animals.. My 0.02 Given Microsoft's track record, would you really want to rely on them for ANYTHING involving Security? [Correct answer: No] -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php