php-general Digest 2 Jul 2005 17:12:57 -0000 Issue 3545
php-general Digest 2 Jul 2005 17:12:57 - Issue 3545 Topics (messages 218011 through 218026): WebHosting suggestions 218011 by: John Jairo Vega Angulo 218012 by: Jasper Bryant-Greene 218022 by: Greg Donald 218023 by: Computer Programmer 218025 by: The Doctor http scanner 218013 by: timothy johnson Re: PHP vs. ColdFusion 218014 by: Stut Currency stored as cents 218015 by: Satyam 218017 by: Jasper Bryant-Greene 218021 by: Satyam Re: getting a filename [with no extension] out of a url 218016 by: Burhan Khalid Returned mail: Data format error 218018 by: Post Office memcached and objects. 218019 by: Rodolfo Gonzalez Gonzalez Re: Moving PEAR installation (for self-contained class library) 218020 by: Burhan Khalid Re: domxml_load_mem()/_file() 218024 by: Jochem Maas Returned mail: see transcript for details 218026 by: Post Office Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-general@lists.php.net -- ---BeginMessage--- Hi, hope you have a good programming: I'm still a novice in php topics and I'm looking forward to find a FREE hosting site to publish my .php's, so I hope you could give me an advise, and if the service provides MySQL hosting too, it would be great. That's all, greetings from a really php fan. Thanks in advance. John -- Too much fantasy loses reality, too much hope may seem somehow empty -Toriyama Akira ---End Message--- ---BeginMessage--- John Jairo Vega Angulo wrote: Hi, hope you have a good programming: I'm still a novice in php topics and I'm looking forward to find a FREE hosting site to publish my .php's, so I hope you could give me an advise, and if the service provides MySQL hosting too, it would be great. That's all, greetings from a really php fan. Thanks in advance. John I'm very much of the opinion that you get what you pay for when it comes to hosting. If you can even find a free PHP and MySQL host, they're likely to be crap. If you're only playing around with PHP (which I can only assume you are, as you want a free host), I would suggest that you simply install PHP and MySQL on your computer and host it locally. If you're planning on publishing the files so that other people can use your application, I suggest you consider paying a small fee for the service, as you will end up much better off. Jasper ---End Message--- ---BeginMessage--- On 7/2/05, John Jairo Vega Angulo [EMAIL PROTECTED] wrote: I'm still a novice in php topics and I'm looking forward to find a FREE hosting site to publish my .php's Free web hosts suck. I have to deal with them all the time, trust me. People download my free PHP scripts then complain to me why they won't run. I go take a look and usually find safe mode on and lots of functions disabled. If you truly cannot afford a small web hosting account, do yourself a favor and install PHP locally instead. You'll be happy that you control all your own settings. On the other hand if a few dollars per month is in your budget, paid web hosting can be had. Here are some very good hosting companies I've used recently: http://ocstech.com - these guys cater to your specific version requests. You tell them what versions of everything you want and they hook it up and make it happen. I got PHP 5, MySQL 4.1, and Ruby on Rails for $6.95/month. http://eleven2.com - These guys are super cheap and very stable. They stick with whatever the CPanel folks are calling 'stable' at any given moment. My site was living on a fairly vacant quad xeon box while there. Very security minded setup too. $6.95/month and up. http://geekhosting.com - Super cheap. $1.95/month and up. I'm not affiliated with any of those companies btw, I used their services and thought they were good. YMMV. -- Greg Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/ ---End Message--- ---BeginMessage--- Here are some sites that list free PHP web host: http://www.oinko.net/freephp/ http://www.free-php-hosting.com/ http://www.web-hosting.com.bz/ I do agree with the other people who replied that you should pay for your web hosting needs. However, when I was starting out with PHP, I had to rely on several of the free PHP web host provider out there. Sure, they won't last long but I don't really need them to last long. I just need them so that I would be able to learn PHP. Back then, I don't even know how to install PHP in my computer. Those free PHP web host provider really did help me get hooked with PHP. ^_^ I was first hosted at F2S (Freedom 2 Surf) but they don't offer free hosting anymore. I'm not sure if they still offer their services. You could also try Lycos UK
php-general Digest 3 Jul 2005 05:34:03 -0000 Issue 3546
php-general Digest 3 Jul 2005 05:34:03 - Issue 3546 Topics (messages 218027 through 218046): Re: Conversion of period and space for $_GET, $_REQUEST,etc. is rather senseless 218027 by: Joe Krahn 218028 by: Joe Krahn 218041 by: Richard Lynch mail()===false but msg is sent! 218029 by: Andy Pieters 218033 by: Jasper Bryant-Greene 218039 by: Manuel Lemos 218040 by: Richard Lynch Delivery reports about your e-mail 218030 by: Mail Delivery Subsystem x years old 218031 by: Ryan A 218034 by: Jasper Bryant-Greene 218035 by: Colin Ross 218036 by: disguised.jedi.gmail.com 218037 by: Ryan A 218038 by: Ryan A 218042 by: Matthew Weier O'Phinney Re: Currency stored as cents 218032 by: Jasper Bryant-Greene 218046 by: Tom Rogers auto reply framework 218043 by: Nate Tanner 218044 by: Rodolfo Gonzalez Gonzalez Re: memcached and objects. 218045 by: Rodolfo Gonzalez Gonzalez Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-general@lists.php.net -- ---BeginMessage--- Richard Lynch wrote: On Thu, June 30, 2005 8:47 pm, Joe Krahn said: PHP imports GET and POST data to array elements by senselessly converting periods and spaces to underscore. The intent is to make strings variable-name compatible for conversion directly into global variables via import_request_variables or register_globals. Honestly?... Why in the world would you have variable names or even array keys with such weird keys anyway, other than the imagemaps, of course? [shrug] I was trying to create a form whose value names would match key names from a database. To avoid conflict, I decided to prefix the other form values with a period, and was surprised that it didn't work. The easy fix was to use another 'special character', but PHP documentation did not make it clear which characters are 'special', so I tested all 256. I was even more surprised that a period is special, but control characters are not. String-to-variable name mangling should only occur when being converted to variable names, but should be left as is when accessed as array elements. The current implementation is particularly bad because it mangles only periods and spaces, but leaves alone other special/unusual characters. Furthermore, the direct conversion into global name space is discouraged for security reasons. A feature-request was made related to this, but it was marked as Won't Fix, primarily due to compatibility concerns. However, I think it's a poor design, and there must be some compatible way to move beyond this misfeature. You'd break an awful lot of backwards-compatibility, for anybody actually relying on it... The biggest one being for INPUT TYPE=IMAGE and image map ,x and ,y variables. If it weren't for those, I'd day go ahead and change it. There probably aren't THAT many users affected by anything else. It would be nice if the original design had only mangled the variable names and not the array keys, but changing it now... Just too many applications are gonna get broken big-time. ... I'm not unsympathic to your plight, and you're absolutely right it would have been a better Design had somebody thought to do it that way, oh, 10 years ago... Well, I I think PHP will be around for a long time, so we're still in the early days of PHP. How's this for a trvial backwards-compatible fix -- for array keys, populate both mangled and unmangled keys. HEY! Just noticed your email address... Can you turn off that stupid auto-responder thingie from rr.com that keeps spamming the list about viruses it deleted? Thanks. [I think it's rr.com, right?...] It's the admin people... I have no control. They probably think it's safer to let list people know of a virus than to avoid the extra spam. Well, I'll send them an email anyhow. Joe Krahn ---End Message--- ---BeginMessage--- Richard Lynch wrote: On Thu, June 30, 2005 8:47 pm, Joe Krahn said: PHP imports GET and POST data to array elements by senselessly converting periods and spaces to underscore. The intent is to make strings variable-name compatible for conversion directly into global variables via import_request_variables or register_globals. Honestly?... Why in the world would you have variable names or even array keys with such weird keys anyway, other than the imagemaps, of course? [shrug] I was trying to create a form whose value names would match key names from a database. To avoid conflict, I decided to prefix the other form values with a period, and was surprised that it didn't work. The easy fix was to use another 'special character', but PHP documentation did not make it clear which characters are 'special',
[PHP] Re: WebHosting suggestions
John Jairo Vega Angulo wrote: Hi, hope you have a good programming: I'm still a novice in php topics and I'm looking forward to find a FREE hosting site to publish my .php's, so I hope you could give me an advise, and if the service provides MySQL hosting too, it would be great. That's all, greetings from a really php fan. Thanks in advance. John I'm very much of the opinion that you get what you pay for when it comes to hosting. If you can even find a free PHP and MySQL host, they're likely to be crap. If you're only playing around with PHP (which I can only assume you are, as you want a free host), I would suggest that you simply install PHP and MySQL on your computer and host it locally. If you're planning on publishing the files so that other people can use your application, I suggest you consider paying a small fee for the service, as you will end up much better off. Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] http scanner
I am still writing a script for my friend he asked me about being able to scan strings and make any strings that have http links in them, able to be an anchor in a broswer, as I am sure I am not the first to do this, any one have any ideas??? I am on php.net looking thru the functions see lots of ides but nothing that seems to want to work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP vs. ColdFusion
Andrew Scott wrote: I agree with you, but why does the installer package not come with everything to get you going to begin with, that was my original question to begin with a long time ago not on this list of course. I can't speak for whoever made the decision to keep what's included with the installer to the most commonly used modules but I think it's safe to assume the reason was to avoid unnecessary bloat. Why include something you probably won't need? KiSS and life will be easier. Anyways, I'm done with this now. You clearly have no specific technical reason for believing CF is better than PHP beyond the installation process which I'm sure we can both agree is not enough to sway the decision either way. I for one think it's a very good thing that it's a fairly manual process, but each to his own. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Currency stored as cents
The lack of a specific type to store monetary values is something of a problem with commercial applications. Be it that you have value added tax or sales tax to add per-item to an invoice or any other calculation like commissions, discounts and such, you end up with an endless number of insignificant decimals which cause trouble. If you forget to round off the extra decimals, comparing for equality doesn't always work, if you carry a running total with the whole decimals, the total of the invoice might not always come good, as the rounding of the total might differ from the total of the rounded individual values. Been there, wrecked that. I've been avoiding this traps out of discipline and hard work, but it is really tiresome. Thus, I was thinking, is there a better way? Even Microsoft added a currency data type to its Visual Basic long ago. Shall we wait? In the meantime, how about storing monetary values as integers, and storing them in the database as integers as well. You see, to show them in the screen, I always pass them through a formatting function. Whenever I read them from the user input, I do it through a parsing function. If those functions scale the value the appropriate number of decimal places, nobody cares how it is used internally. And currency values, no matter what you do with them, they always scale the same way. You will never multiply two currency values together. There is no such a thing as dollars-squared. If you have two positions for cents, it will always be so, no matter what you do with them. I guess, it would be prudent to have a scaling factor to allow for, for example, tenths of cents. Several kind of businesses express their unit prices in fraction of cents, because they never actually sell units and the difference does add up in the total. So, you might set that factor to zero, for those currencies that use no cents (as was the case with the Italian Lira or the Spanish Peseta), two, as for the Euro or Dollar, or even three or four, for certain specific business. Anyhow, the only functions that would care about this scaling factor would be the user input/output functions, internally within the application, you wouldn't care. Actually, it would need to values, the scaling factor (which might be three) and the number of decimal places (which might be two). Of course, integers have a range limit, and the type of business has to be the kind that manages with only that. Now, am I missing something in all this? Please comment. Thanks Satyam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting a filename [with no extension] out of a url
Richard Davey wrote: Hello Graham, Friday, July 1, 2005, 12:54:42 AM, you wrote: GA if $_SERVER['SCRIPT_NAME'] give this GA /folder/folder/Library/php/filename.php $_SERVER['SCRIPT_NAME'] won't give you that, $_SERVER['SCRIPT_FILENAME'] would. SCRIPT_NAME would just give you /filename.php And if you need to remove the slash at the start, pick any of the following: substr, str_replace, preg_replace, strpos, etc. echo basename($_SERVER['SCRIPT_FILENAME'],'.php') -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Currency stored as cents
Satyam wrote: Now, am I missing something in all this? Please comment. Thanks Satyam Just use the Arbitrary Precision Mathematics functions in PHP, set to a precision of 2 decimal places. There's bcmath[1] and GMP[2]. Jasper [1] http://www.php.net/bc [2] http://www.php.net/gmp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Returned mail: Data format error
Virus Warning Message The virus (W32/[EMAIL PROTECTED]) was detected in the attachment mail.zip. The attached File mail.zip has been removed. Nachfolgender Virus (W32/[EMAIL PROTECTED]) wurde im Attachment mail.zip gefunden, deshalb wurde das Attachment mail.zip gelöscht. Für Fragen dazu steht Ihnen der chello Helpdesk sehr gerne zur Verfügung. Weitere Informationen zum Virenschutz: http://portal.chello.at/av-info.html Le serveur de mail chello a détecté le virus W32/[EMAIL PROTECTED] dans le fichier mail.zip inclus dans ce mail. Ce fichier mail.zip a donc été supprimée pour en éviter la diffusion. Pour plus d'information, merci de cliquer sur le lien suivant http://www.chello.fr Az Önnek kézbesített levél mellékletében a vírusszűrő rendszer a(z) W32/[EMAIL PROTECTED] nevű vírust találta, ezért a(z) mail.zip nevű mellékletet biztonsági okokból eltávolította. További információért, kérjük kattintson az alábbi hivatkozásra: http://home.hun.chello.hu/upcmnfc/start/szolgaltatas/biztonsag/virussz_res_gyik/ V příloze mail.zip byl detekován virus W32/[EMAIL PROTECTED] Příloha mail.zip byla proto odstraněna. Pro dotazy kontaktujte prosím technickou podporu. W załączniku mail.zip wykryto wirus W32/[EMAIL PROTECTED] Plik mail.zip został usunięty. Więcej informacji znajdziesz na stronie internetowej: http://home.pol.chello.pl/upcmnfc/start/pomoc/wirusy/ V priloženom súbore mail.zip bol zistený vírus (W32/[EMAIL PROTECTED]). Súbor mail.zip bol odstránený. V prípade otázok prosím kontaktujte linku technickej podpory. http://www.chello.sk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] memcached and objects.
Good morning, I would like to use PHP's memcached extension to store objects. However I keep getting the incomplete object everytime I try to operate on an object got from the cache. How can be an object stored in memcached and later recovered to work with it?. Is this possible?. I would thank you a lot if you point me to some example. Thanks in advanced. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moving PEAR installation (for self-contained class library)
Andrei Verovski (aka MacGuru) wrote: Hi, I have a PEAR-related question. My class library using some PEAR packages, and I would like to make it self-contained, i.e. to be able to move it to a server (for example MacOS X) which do not have (and will not require) installation of any PEAR package(s). What I would like to do is just to copy whole PEAR directory from the /usr/share/php5 in the corresponding subdir of my class library. The question is - how to make this work transparently. What global php_ini variables need to be changed? Just ¨include_path¨ or anything else? Did you already have a look at http://pear.php.net/manual/en/installation.shared.php ? I think it covers most of your questions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Currency stored as cents
I would rather use native data types and functions. This is a good idea when you have to deal with the balance sheet of a corporation, where you have to handle huge numbers and still be precise up to the last cent. For most retail business, where the largest amount can still be expressed in cents within the range of a 32 bit integer, the bcmath package is like overkill. Satyam Jasper Bryant-Greene [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Satyam wrote: Now, am I missing something in all this? Please comment. Thanks Satyam Just use the Arbitrary Precision Mathematics functions in PHP, set to a precision of 2 decimal places. There's bcmath[1] and GMP[2]. Jasper [1] http://www.php.net/bc [2] http://www.php.net/gmp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WebHosting suggestions
On 7/2/05, John Jairo Vega Angulo [EMAIL PROTECTED] wrote: I'm still a novice in php topics and I'm looking forward to find a FREE hosting site to publish my .php's Free web hosts suck. I have to deal with them all the time, trust me. People download my free PHP scripts then complain to me why they won't run. I go take a look and usually find safe mode on and lots of functions disabled. If you truly cannot afford a small web hosting account, do yourself a favor and install PHP locally instead. You'll be happy that you control all your own settings. On the other hand if a few dollars per month is in your budget, paid web hosting can be had. Here are some very good hosting companies I've used recently: http://ocstech.com - these guys cater to your specific version requests. You tell them what versions of everything you want and they hook it up and make it happen. I got PHP 5, MySQL 4.1, and Ruby on Rails for $6.95/month. http://eleven2.com - These guys are super cheap and very stable. They stick with whatever the CPanel folks are calling 'stable' at any given moment. My site was living on a fairly vacant quad xeon box while there. Very security minded setup too. $6.95/month and up. http://geekhosting.com - Super cheap. $1.95/month and up. I'm not affiliated with any of those companies btw, I used their services and thought they were good. YMMV. -- Greg Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: WebHosting suggestions
Here are some sites that list free PHP web host: http://www.oinko.net/freephp/ http://www.free-php-hosting.com/ http://www.web-hosting.com.bz/ I do agree with the other people who replied that you should pay for your web hosting needs. However, when I was starting out with PHP, I had to rely on several of the free PHP web host provider out there. Sure, they won't last long but I don't really need them to last long. I just need them so that I would be able to learn PHP. Back then, I don't even know how to install PHP in my computer. Those free PHP web host provider really did help me get hooked with PHP. ^_^ I was first hosted at F2S (Freedom 2 Surf) but they don't offer free hosting anymore. I'm not sure if they still offer their services. You could also try Lycos UK (http://www.lycos.co.uk). However, Asian countries are banned from registering. There's also 90Megs.com and a lot of others like them that uses advertisement to power their site. Not sure how long they will last though. Ang sabi sa akin ni John Jairo Vega Angulo noong 01:05 PM 7/2/2005... Hi, hope you have a good programming: I'm still a novice in php topics and I'm looking forward to find a FREE hosting site to publish my .php's, so I hope you could give me an advise, and if the service provides MySQL hosting too, it would be great. That's all, greetings from a really php fan. Thanks in advance. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] domxml_load_mem()/_file()
Chris Boget wrote: If it's because of memory issues then it will indicated by an error message saying that your script has tried to allocate more than the allowed memory limit (and it's easy to fix by adjusting this limit in php.ini) Actually, I'm not getting any error at all. The script just halts. I am only guess that it's a memory issue because the file is so large and because when I shrink the file down, everything works. After alot of additional testing, it turns out the problem isn't with the domxml_load_*() functions after all. My apologies. Although my script is still halting inexplicably, it seems that the root cause of that is a function I'm using to turn the DOM into an array. The function that I am using is one that I snagged from the user contributed notes for the xml_tree() function and can be found here: http://us2.php.net/manual/de/function.domxml-xmltree.php#25964 I still believe it to be a memory issue but for the life of me, can't figure out how I can rework the domxml_xmlarray() exampled in the above link such that it uses the domxml nodes by reference it all starts with the '' char. below is an attempt, not tested, basically everywhere I see that its possible to use a reference I did (I may be wrong), I wasn't sure about the array_merge() line so you will have to test that. I removed an if statement which seemed superfluous and slightly wrong (i.e. if $branch = $branch-next_sibling() returns null what will the subsequent call to $branch-first_child() do??) Also the function does not return by reference (you may want it to), I though it might cause problems with data changing for 'unknown' reasons. Also depending on your php version you may run into the 'call-time-pass-by-reference' depreciated warning. -- if you change the array_merge() line to use references for the passed args: function domxml_xmlarray($branch) { $object = array(); $objptr = $object; $branch = $branch-first_child(); while ($branch !$branch-is_blank_node()) { switch ($branch-node_type()) { case XML_TEXT_NODE: $objptr['cdata'] = $branch-node_value(); break; case XML_ELEMENT_NODE: $objptr = $object[$branch-node_name()][]; break; } if ($branch-has_child_nodes()) { // not sure about referenced args to this function. // $objptr = array_merge($objptr, domxml_xmlarray($branch)); $objptr = array_merge($objptr, domxml_xmlarray($branch)); } $branch = $branch-next_sibling(); } return $object; } let us know how you get on. if it works well it would be nice to post it back to the usernotes as an improved version (go right ahead and take credit, I figure you'll probably have spent enough time/effort getting it to work :-) and not by value and thus compounding the memory usage. Do any of you guys have any ideas? Do any of you use a similar function that isn't as memory intensive? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WebHosting suggestions
On Sat, Jul 02, 2005 at 12:05:49AM -0500, John Jairo Vega Angulo wrote: Hi, hope you have a good programming: I'm still a novice in php topics and I'm looking forward to find a FREE hosting site to publish my .php's, so I hope you could give me an advise, and if the service provides MySQL hosting too, it would be great. That's all, greetings from a really php fan. Thanks in advance. John Have a look at http://www.nk.ca/ -- Member - Liberal International This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED] God Queen and country! Beware Anti-Christ rising! Canada Day 1 July, USA Day 4 July - PARTY ON! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Returned mail: see transcript for details
This message was undeliverable due to the following reason: Your message was not delivered because the destination computer was not reachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there is a network problem that prevented delivery, but it is also possible that the computer is turned off, or does not have a mail system running right now. Your message was not delivered within 2 days: Host 2.250.73.2 is not responding. The following recipients could not receive this message: php-general@lists.php.net Please reply to [EMAIL PROTECTED] if you feel this message to be in error. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Conversion of period and space for $_GET, $_REQUEST,etc. is rather senseless
Richard Lynch wrote: On Thu, June 30, 2005 8:47 pm, Joe Krahn said: PHP imports GET and POST data to array elements by senselessly converting periods and spaces to underscore. The intent is to make strings variable-name compatible for conversion directly into global variables via import_request_variables or register_globals. Honestly?... Why in the world would you have variable names or even array keys with such weird keys anyway, other than the imagemaps, of course? [shrug] I was trying to create a form whose value names would match key names from a database. To avoid conflict, I decided to prefix the other form values with a period, and was surprised that it didn't work. The easy fix was to use another 'special character', but PHP documentation did not make it clear which characters are 'special', so I tested all 256. I was even more surprised that a period is special, but control characters are not. String-to-variable name mangling should only occur when being converted to variable names, but should be left as is when accessed as array elements. The current implementation is particularly bad because it mangles only periods and spaces, but leaves alone other special/unusual characters. Furthermore, the direct conversion into global name space is discouraged for security reasons. A feature-request was made related to this, but it was marked as Won't Fix, primarily due to compatibility concerns. However, I think it's a poor design, and there must be some compatible way to move beyond this misfeature. You'd break an awful lot of backwards-compatibility, for anybody actually relying on it... The biggest one being for INPUT TYPE=IMAGE and image map ,x and ,y variables. If it weren't for those, I'd day go ahead and change it. There probably aren't THAT many users affected by anything else. It would be nice if the original design had only mangled the variable names and not the array keys, but changing it now... Just too many applications are gonna get broken big-time. ... I'm not unsympathic to your plight, and you're absolutely right it would have been a better Design had somebody thought to do it that way, oh, 10 years ago... Well, I I think PHP will be around for a long time, so we're still in the early days of PHP. How's this for a trvial backwards-compatible fix -- for array keys, populate both mangled and unmangled keys. HEY! Just noticed your email address... Can you turn off that stupid auto-responder thingie from rr.com that keeps spamming the list about viruses it deleted? Thanks. [I think it's rr.com, right?...] It's the admin people... I have no control. They probably think it's safer to let list people know of a virus than to avoid the extra spam. Well, I'll send them an email anyhow. Joe Krahn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail()===false but msg is sent!
Hi all I have this situation where mail() returns a false status but the message is actually accepted AND reaches destination! The PHP Version is 4.3.10, the OS Linux So what I do is ( $header=header for multipart mime message; $body=body with multipart mime message; $result=mail(Name Firstname $address,Subject,$message,$header); echo ($result?ok:bogus); So anyone got any ideas? With kind regards Andy -- Registered Linux User Number 379093 -- --BEGIN GEEK CODE BLOCK- Version: 3.1 GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++ L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++) PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+) e$@ h++(*) r--++ y--() -- ---END GEEK CODE BLOCK-- -- Check out these few php utilities that I released under the GPL2 and that are meant for use with a php cli binary: http://www.vlaamse-kern.com/sas/ -- -- pgpnle9RVmE8t.pgp Description: PGP signature
[PHP] Delivery reports about your e-mail
ALERT! This e-mail, in its original form, contained one or more attached files that were infected with a virus, worm, or other type of security threat. This e-mail was sent from a Road Runner IP address. As part of our continuing initiative to stop the spread of malicious viruses, Road Runner scans all outbound e-mail attachments. If a virus, worm, or other security threat is found, Road Runner cleans or deletes the infected attachments as necessary, but continues to send the original message content to the recipient. Further information on this initiative can be found at http://help.rr.com/faqs/e_mgsp.html. Please be advised that Road Runner does not contact the original sender of the e-mail as part of the scanning process. Road Runner recommends that if the sender is known to you, you contact them directly and advise them of their issue. If you do not know the sender, we advise you to forward this message in its entirety (including full headers) to the Road Runner Abuse Department, at [EMAIL PROTECTED] The original message was received at Sat, 2 Jul 2005 18:44:05 -0400 from [80.125.99.107] - The following addresses had permanent fatal errors - php-general@lists.php.net - Transcript of the session follows - ... while talking to 139.222.195.214: 550 5.1.2 php-general@lists.php.net... Host unknown (Name server: host not found) file attachment: file.zip This e-mail in its original form contained one or more attached files that were infected with the [EMAIL PROTECTED] virus or worm. They have been removed. For more information on Road Runner's virus filtering initiative, visit our Help Member Services pages at http://help.rr.com, or the virus filtering information page directly at http://help.rr.com/faqs/e_mgsp.html. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] x years old
Hey guys, This is the code I am using to display a persons age from the mysql db: $day1=strtotime($age); $day2 = strtotime(date(Y-m-d)); $dif_s = ($day2-$day1); $dif_d = ($dif_s/60/60/24); $age = round(($dif_d/365.24)); but when someone entered their birth day($age) as 1988-07-06 it is showing it as 17 years old instead of 16...any idea whats wrong in the above code? Thanks, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Currency stored as cents
Satyam wrote: I would rather use native data types and functions. This is a good idea when you have to deal with the balance sheet of a corporation, where you have to handle huge numbers and still be precise up to the last cent. For most retail business, where the largest amount can still be expressed in cents within the range of a 32 bit integer, the bcmath package is like overkill. Please don't top-post. You make a fair point though. Have you looked at the precision configuration directive [1]? In my applications I just let PHP store as many significant digits as it likes during processing, and use number_format() whenever displaying to limit it to 2 decimal places. That, coupled with storing them as decimals with 2 decimal places in my MySQL databases, achieves everything I need. Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail()===false but msg is sent!
Andy Pieters wrote: So what I do is ( $header=header for multipart mime message; $body=body with multipart mime message; $result=mail(Name Firstname $address,Subject,$message,$header); echo ($result?ok:bogus); Well, firstly your subject does not match what you're doing. PHP is weakly-typed, so $result may be a value that evaluates to FALSE while not actually being a boolean value. In your subject you use the === operator to check types, but you're not doing it in the code sample. You should use echo ($result === false) ? 'bogus' : 'ok'; or similar. Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: x years old
Ryan A wrote: Hey guys, This is the code I am using to display a persons age from the mysql db: $day1=strtotime($age); $day2 = strtotime(date(Y-m-d)); $dif_s = ($day2-$day1); $dif_d = ($dif_s/60/60/24); $age = round(($dif_d/365.24)); but when someone entered their birth day($age) as 1988-07-06 it is showing it as 17 years old instead of 16...any idea whats wrong in the above code? Use floor() instead of round(). Using the round() function will round anyone whose age is above 16.5 to 17, while floor() always rounds down. Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: x years old
and for completeness of the topic, ceil() will round fractions up. i.e. ceil(16.1) = 17 ceil(16.0) = 16 attempted-humor I think the Credit Card Industry using ceil() alot ;P /attempted-humor On 7/2/05, Jasper Bryant-Greene [EMAIL PROTECTED] wrote: Ryan A wrote: Hey guys, This is the code I am using to display a persons age from the mysql db: $day1=strtotime($age); $day2 = strtotime(date(Y-m-d)); $dif_s = ($day2-$day1); $dif_d = ($dif_s/60/60/24); $age = round(($dif_d/365.24)); but when someone entered their birth day($age) as 1988-07-06 it is showing it as 17 years old instead of 16...any idea whats wrong in the above code? Use floor() instead of round(). Using the round() function will round anyone whose age is above 16.5 to 17, while floor() always rounds down. Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: x years old
attempted-humor I think the Credit Card Industry using ceil() alot ;P /attempted-humor attempted-laugh HAHAHAHAHAHAHAHAHAHAah.*sigh* /attempted-laugh -- PHP rocks! Knowledge is Power. Power Corrupts. Go to school, become evil Disclaimer: Any disclaimer attached to this message may be ignored. However, I must say that the ENTIRE contents of this message are subject to other's criticism, corrections, and speculations. This message is Certified Virus Free -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: x years old
Hey, On 7/3/2005 2:12:35 AM, Colin Ross ([EMAIL PROTECTED]) wrote: and for completeness of the topic, ceil() will round fractions up. i.e. ceil(16.1) = 17 ceil(16.0) = 16 attempted-humor I think the Credit Card Industry using ceil() alot ;P /attempted-humor Well, either i am dumb or that is pretty good humour coz I found it funny :-) Cheers, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: x years old
Use floor() instead of round(). Using the round() function will round anyone whose age is above 16.5 to 17, while floor() always rounds down. Thanks mate...silly me. Cheers, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail()===false but msg is sent!
Hello, on 07/02/2005 07:11 PM Andy Pieters said the following: Hi all I have this situation where mail() returns a false status but the message is actually accepted AND reaches destination! The PHP Version is 4.3.10, the OS Linux So what I do is ( $header=header for multipart mime message; $body=body with multipart mime message; $result=mail(Name Firstname $address,Subject,$message,$header); echo ($result?ok:bogus); So anyone got any ideas? The mail function practically never fails under Linux because it just handles the message to sendmail program or equivalent. This may be a mail() function bug. In any case, you may want to try this class that comes with a wrapper function named sendmail_mail(). It works like mail() and takes the same arguments but it calls sendmail program directly. If it also fails, it may be a problem in your sendmail installation. Otherwise, it is a problem in the mail() function. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail()===false but msg is sent!
On Sat, July 2, 2005 3:11 pm, Andy Pieters said: I have this situation where mail() returns a false status but the message is actually accepted AND reaches destination! The PHP Version is 4.3.10, the OS Linux So what I do is ( $header=header for multipart mime message; $body=body with multipart mime message; $result=mail(Name Firstname $address,Subject,$message,$header); Not that it's relevant (almost for sure), but in this example, you use $message where you probably want $body... echo ($result?ok:bogus); So anyone got any ideas? You'd have to read the PHP source code to be certain, but let's assume that PHP just uses whatever your sendmail setting in php.ini returns. It's possible, though very unlikely, that you've done something silly there like: sendmail = /usr/bin/sendmail -t ; return -1; What's more likely is that something in the command line of sendmail is returning some kind of warning, but it's still managing to send the message. If you can, su to the PHP user (see User directive in httpd.conf) and then run some test sendmail commands from the shell. Odds are really good you'll get a more detailed feedback than PHP's simplistic true/false return value. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Conversion of period and space for $_GET, $_REQUEST, etc. is rather senseless
On Sat, July 2, 2005 11:35 am, Joe Krahn said: Richard Lynch wrote: I'm not unsympathic to your plight, and you're absolutely right it would have been a better Design had somebody thought to do it that way, oh, 10 years ago... Well, I I think PHP will be around for a long time, so we're still in the early days of PHP. You may be. I'm pretty old in PHP :-) How's this for a trvial backwards-compatible fix -- for array keys, populate both mangled and unmangled keys. Seems good... Except it would break a few zillion scripts that iterate through all of $_POST and spew off an email with it all. Yeah, maybe they should only accept expected keys, but who cares for an email to admin? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: x years old
* Ryan A [EMAIL PROTECTED]: This is the code I am using to display a persons age from the mysql db: $day1=strtotime($age); $day2 = strtotime(date(Y-m-d)); Just to be pedantic... just use time() for the above statement; no reason to do extra work here. (date() will actually call time() anyways) $dif_s = ($day2-$day1); $dif_d = ($dif_s/60/60/24); $age = round(($dif_d/365.24)); And, as someone else mentioned, you want to do floor() here, as somebody is 16 until their 17th birthday. -- Matthew Weier O'Phinney Zend Certified Engineer http://weierophinney.net/matthew/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] auto reply framework
I'm working on the design of a program for sending automatic messages to users, based on certain conditions. It seems like there should be some sort of framework for this sort of thing, but I'm not sure what it would be called, besides auto-reply framework. I didn't find anything when searching for that. Here's an example of what I'm talking about: Message M0 should be sent to - all current users of service S - where membership expiration is in 30 days from today Message M1 should be sent to - all current users of service S - where membership level == premium - where signup date was 45 days ago Message M2 should be sent to - former users of service S - where membership expiration was at least 30 days ago Message M3 should be sent to - former users of service S - where membership expiration was at least 60 days ago - where user already got message M2 at least 30 days ago Etc. Etc. So the point is that I need to be able to set up rules for what each message contains, and when each message should be sent, based on selected conditions. Is there anything out there (PHP/Mysql solution preferably) that might give some help with something like this? Thanks, Nate
Re: [PHP] auto reply framework
On Sat, 2 Jul 2005, Nate Tanner wrote: I'm working on the design of a program for sending automatic messages to users, based on certain conditions. It seems like there should be some So the point is that I need to be able to set up rules for what each message contains, and when each message should be sent, based on selected conditions. Is there anything out there (PHP/Mysql solution preferably) that might give some help with something like this? Hi Nate, maybe something here could help you: http://freshmeat.net/search/?q=membershipsection=projectsGo.x=0Go.y=0 I have done similar things with perl (could be also php from cli) and crontab, and a web interface for setting up things, but all handmade. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] memcached and objects.
On Sat, 2 Jul 2005, Jochem Maas wrote: I would like to use PHP's memcached extension to store objects. However I keep getting the incomplete object everytime I try to operate on an load the class definition BEFORE you try to extract the object from the cache. Thanks to Jochem and Brad for your answers. I see now where my problem is. I forgot to post that the objects I want to cache are recordsets generated by Adodb. However, since the recordset class is generated by Adodb with a (I guess) factory class, and the object's class is not defined in a file with the same name as the class, how to figure out which file to load :-S ? ... I've googled to see if there's some sample code for caching adodb recordsets, without success so far. Is someone aware of some class to cache Adodb recordsets in memcached?. Thanks again, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Currency stored as cents
Hi, Saturday, July 2, 2005, 6:57:07 PM, you wrote: S The lack of a specific type to store monetary values is something of a S problem with commercial applications. Be it that you have value added tax S or sales tax to add per-item to an invoice or any other calculation like S commissions, discounts and such, you end up with an endless number of S insignificant decimals which cause trouble. If you forget to round off the S extra decimals, comparing for equality doesn't always work, if you carry a S running total with the whole decimals, the total of the invoice might not S always come good, as the rounding of the total might differ from the total S of the rounded individual values. Been there, wrecked that. I've been S avoiding this traps out of discipline and hard work, but it is really S tiresome. S Thus, I was thinking, is there a better way? Even Microsoft added a S currency data type to its Visual Basic long ago. Shall we wait? S In the meantime, how about storing monetary values as integers, and storing S them in the database as integers as well. You see, to show them in the S screen, I always pass them through a formatting function. Whenever I read S them from the user input, I do it through a parsing function. If those S functions scale the value the appropriate number of decimal places, nobody S cares how it is used internally. And currency values, no matter what you do S with them, they always scale the same way. You will never multiply two S currency values together. There is no such a thing as dollars-squared. If S you have two positions for cents, it will always be so, no matter what you S do with them. S I guess, it would be prudent to have a scaling factor to allow for, for S example, tenths of cents. Several kind of businesses express their unit S prices in fraction of cents, because they never actually sell units and the S difference does add up in the total. So, you might set that factor to zero, S for those currencies that use no cents (as was the case with the Italian S Lira or the Spanish Peseta), two, as for the Euro or Dollar, or even three S or four, for certain specific business. Anyhow, the only functions that S would care about this scaling factor would be the user input/output S functions, internally within the application, you wouldn't care. Actually, S it would need to values, the scaling factor (which might be three) and the S number of decimal places (which might be two). S Of course, integers have a range limit, and the type of business has to be S the kind that manages with only that. S Now, am I missing something in all this? Please comment. Thanks S Satyam I store dollar amounts as integers and use this function to convert function dollars2cents($value){ $value = sprintf(%0.2f,trim($value)); list($a,$b) = explode('.',$value); if(floatval($value)0) $b = $b*-1; //negative amount? return intval($a)*100 + intval($b); } -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php