php-general Digest 5 Aug 2009 10:47:47 -0000 Issue 6268
php-general Digest 5 Aug 2009 10:47:47 - Issue 6268 Topics (messages 296306 through 296317): Re: Need quick got written up yesterday!! OUCH (RESOLVED) 296306 by: HallMarc Websites 296307 by: Paul M Foster 296308 by: Govinda 296309 by: Eric Butera 296310 by: Shawn McKenzie Re: Multiple MySQL Queries 296311 by: sono-io.fannullone.us 296315 by: sono-io.fannullone.us Warning: OutsourcingRoom.com 296312 by: Daniel Brown 296313 by: Steve 296316 by: Ashley Sheridan Re: Compare PHP settings of two different servers 296314 by: Dave M G 296317 by: Robert Cummings Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- -Original Message- From: Paul M Foster [mailto:pa...@quillandmouse.com] Sent: Tuesday, August 04, 2009 5:44 PM To: php-gene...@lists.php.net Subject: Re: [PHP] Need quick got written up yesterday!! OUCH (RESOLVED) On Tue, Aug 04, 2009 at 12:42:11PM -0500, Shawn McKenzie wrote: Miller, Terion wrote: Shawn you know repeatedly have been nothing but an asshole to me on this list, I have said before I'm not a php programmer, I was a front end designer, need graphics , need a css layout...see meneed backend programming..I'm trying... Stop being such a egomaniacal dickhead, a social life may do you good. Dearest Terion, If by repeatedly, you mean twice, then yes I'll agree. I've also helped and/or solved your issues more than twice (once being today if you've read it and followed it). Most often my intent was to get you to try and learn and troubleshoot your own issues instead of posting the same code problems and syntax errors over and over. You come to this list repeatedly with errors that are caused by a total lack of understanding, and in my opinion, a total lack of due diligence on your part. It's not today or the past week or the past several weeks, it's been for quite some time with little or no improvement. If by being an asshole, you mean the time that I suggested that you get an editor with syntax checking/highlighting because you posted a whole page of wrapped code that had a syntax error (missing semicolon), then yes I have been, though a helpful asshole with good intentions. At some point it gets obnoxious. When is that point? It differs depending upon the person. Many on this list have just stopped replying to your posts altogether. I like them need to see an attempt to help ones self occasionally before I continue with help. I wasn't defending your boss yelling at you, that's rarely appropriate. However, after the many posts from you on this list, to see Need quick got written up yesterday!! OUCH, I felt like yelling at you, Need payment doing your work!! CONSTANTLY :-) As a CSS/HTML/graphics designer, did you take this job with the understanding that you'd have to learn PHP or did they just thrust it upon you? If the former, then you need to buckle down and learn it in a constructive manner. If your social life needs to suffer for a short time, then that's what it takes. If the latter, then maybe talk to them about some company paid training and mentoring from someone helpful that knows backend programming and PHP. I may be a dickhead, but not egomaniacal. There are many better PHP gurus on this list than I, and I know it. Unfortunately, many of them are ignoring your posts entirely. At present my social life is actually overwhelming my ability to devote time to PHP coding, however if you'd like to send pictures I'll give them a look see. I can understand your frustration and can tell that you're very stressed, so I will attempt to not be an asshole nor a dickhead, but please show a little more devotion to learning and helping yourself. I have to agree with Shawn on most everything. I'm one of those people who've chosen not to pay attention to your posts. The masses of code you post are nearly indecipherable, and you seem to be constantly tripped up by syntax errors, etc. PJ blew it with me in the same way. PJ, too, is not a professional coder. And like you, he seems to be unwilling to buckle down and study the language, preferring instead to come to experts here to get free tutoring. But at some point, the patience of people on this list runs out, and rather than excoriating you, they simply stop helping you. My point here is not to insult you or denigrate your abilities. You may be a very nice person, and quite talented at doing the things you're trained to do. But programming in PHP is apparently not one of them. And
Re: [PHP] Warning: OutsourcingRoom.com
On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compare PHP settings of two different servers
Dave M G wrote: Bob, Ben, David, Robert, Thank you all for responding. Just to recap, I'm trying to find out why I can write text into a PNG image on one server, but not on another. After much playing around, I have a list of the different configuration modules installed on the two servers. The lists below are lists of the modules *not* in common between them. From what I can see, none of the modules that the behaving server have that the misbehaving server doesn't has anything to do with fonts or images. So my suspicion is starting to be that maybe the problem is not in the PHP set up, but elsewhere. Before I move on to other possible solutions, I'd like to double check with more experienced eyes. Do any of the modules here affect text in PNG files? Misbehaving Server: '--enable-ftp' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo' '--enable-soap' '--enable-zip' '--with-apxs2' '--with-curl' '--with-curl=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-mcrypt' '--with-mhash' '--with-openssl' '--with-pear' '--with-pdo-mysql' '--with-pdo-sqlite' '--with-sqlite' '--with-xmlrpc' '--with-unixODBC=/usr' Behaving Server: '--disable-pdo' '--enable-libxml' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-freetype-dir=/usr' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-libxml-dir=/opt/xml2/' '--with-mime-magic' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-xpm-dir=/usr/X11R6' And, just to note, *both* servers have the following: * '--with-gd' * '--with-ttf' * '--enable-gd-native-ttf' These are the command line arguments used to enable/disable extensions. They don't guarantee that the extension is actually enabled though. Check the extensions in phpinfo() output. Each properly enabled extensions should have a little header. You are also trying to manipulate a PNG file... I believe that relies on libpng-dev and may require --with-png-dir=/usr/lib. I usually compile PHP myself so I'm not sure what the defaults are for various distros. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Character encoding
Hi, I have a mysql database, which the users can insert comments. As the users can be from different countries, with different character encoding, the mysql table can contain various special characters. How can I be sure to display these comments properly? I've found the mb_convert_encoding, and for some characters it works okay, but there are some really special characters which displayed as a '?'. Does anybody know some workarounds? Thanks, SanTa
[PHP] Re: PHP programming strategy
Thank you to all of you who have commented on this query. On the subject of comments, I feel that Larry Garfield settled this query by pointing out that halving the size of a particular document gave a barely noticeable increase in speed. Paul Foster pointed out the problem of maintenance, but if, as I do, you do your development in-house, and then upload the working copies of the program, it would be possible to strip out comments when you upload it. If you were really paranoid, this could have the advantage that if somebody managed to steal your code from the server it would be that much harder for them to understand. On the other hand the process of stripping out the comments could potentially introduce new bugs, and I think this consideration would outweigh anything else. I have recently come to the conclusion that I should never consider anything completed until I have analysed the HTML code for an actual page. It is amazing how badly mangled tables and the like can be without producing any visible effect on the page, and on several occasions I have found PHP error messages which were mixed up with the HTML in such a way that they were not displayed at all. On at least one occasion this gave me the clue to an otherwise baffling bug. I have also discovered that the process of analysing the HTML is made substantially simpler by inserting HTML comments into the output; e.g. instead of Echo '/td/tr/table/td/tr/table'; write ? /td/tr/table !-End of table 2 ' /td/tr/table !-End of table 1 ' Unfortunately, for HTML readability, it is highly desirable not to indent the code, and if you are trying to have nicely indented braces, this makes the PHP code that much harder to interpret. And on the question of functions there is some virtue (primarily from the point of view of maintenance) in not having individual files too large, so while it seems to be the general consensus that splitting up functions into groups to give smaller files will probably slow things down a bit, if they can be grouped into sets which are only loaded in particular circumstances this would be worth doing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP programming strategy
On Wed, 2009-08-05 at 21:49 +1000, Clancy wrote: Thank you to all of you who have commented on this query. On the subject of comments, I feel that Larry Garfield settled this query by pointing out that halving the size of a particular document gave a barely noticeable increase in speed. Paul Foster pointed out the problem of maintenance, but if, as I do, you do your development in-house, and then upload the working copies of the program, it would be possible to strip out comments when you upload it. If you were really paranoid, this could have the advantage that if somebody managed to steal your code from the server it would be that much harder for them to understand. On the other hand the process of stripping out the comments could potentially introduce new bugs, and I think this consideration would outweigh anything else. I have recently come to the conclusion that I should never consider anything completed until I have analysed the HTML code for an actual page. It is amazing how badly mangled tables and the like can be without producing any visible effect on the page, and on several occasions I have found PHP error messages which were mixed up with the HTML in such a way that they were not displayed at all. On at least one occasion this gave me the clue to an otherwise baffling bug. I have also discovered that the process of analysing the HTML is made substantially simpler by inserting HTML comments into the output; e.g. instead of Echo '/td/tr/table/td/tr/table'; write ? /td/tr/table !-End of table 2 ' /td/tr/table !-End of table 1 ' Unfortunately, for HTML readability, it is highly desirable not to indent the code, and if you are trying to have nicely indented braces, this makes the PHP code that much harder to interpret. And on the question of functions there is some virtue (primarily from the point of view of maintenance) in not having individual files too large, so while it seems to be the general consensus that splitting up functions into groups to give smaller files will probably slow things down a bit, if they can be grouped into sets which are only loaded in particular circumstances this would be worth doing. Nested tables are the devils playthings! Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP programming strategy
On Wed, Aug 5, 2009 at 8:02 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 21:49 +1000, Clancy wrote: Thank you to all of you who have commented on this query. On the subject of comments, I feel that Larry Garfield settled this query by pointing out that halving the size of a particular document gave a barely noticeable increase in speed. Paul Foster pointed out the problem of maintenance, but if, as I do, you do your development in-house, and then upload the working copies of the program, it would be possible to strip out comments when you upload it. If you were really paranoid, this could have the advantage that if somebody managed to steal your code from the server it would be that much harder for them to understand. On the other hand the process of stripping out the comments could potentially introduce new bugs, and I think this consideration would outweigh anything else. I have recently come to the conclusion that I should never consider anything completed until I have analysed the HTML code for an actual page. It is amazing how badly mangled tables and the like can be without producing any visible effect on the page, and on several occasions I have found PHP error messages which were mixed up with the HTML in such a way that they were not displayed at all. On at least one occasion this gave me the clue to an otherwise baffling bug. I have also discovered that the process of analysing the HTML is made substantially simpler by inserting HTML comments into the output; e.g. instead of Echo '/td/tr/table/td/tr/table'; write ? /td/tr/table !-End of table 2 ' /td/tr/table !-End of table 1 ' Unfortunately, for HTML readability, it is highly desirable not to indent the code, and if you are trying to have nicely indented braces, this makes the PHP code that much harder to interpret. And on the question of functions there is some virtue (primarily from the point of view of maintenance) in not having individual files too large, so while it seems to be the general consensus that splitting up functions into groups to give smaller files will probably slow things down a bit, if they can be grouped into sets which are only loaded in particular circumstances this would be worth doing. Nested tables are the devils playthings! Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I would agree there...we have an app that allows users to create forms dynamically with a left and right panel section along with some full width plug-in. At a minimum this is built with three nested tables. Here's the really rotten part, the VP (original dev for the display code) screwed a table close up somewhere. A bug they found literally minutes before it when to prod at a client site, instead of giving me 15 minutes to trace it down, they wrapped the entire table structure in another table to make it look pretty. Drives me mental as it produces lots a visual screw up when a certain pattern in the form elements is created -- Bastien Cat, the other other white meat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: OutsourcingRoom.com
On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: OutsourcingRoom.com
On Wed, 2009-08-05 at 09:54 -0400, Eric Butera wrote: On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ Is there nothing that anybody can actually do about this? Where is the new company based? Are there laws in that country about this sort of thing? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: OutsourcingRoom.com
Nobody can actually do anything. This happen all the time. Sites like facebook or myspace send invitations to all your mail's contacts, but that's not the problem. What I can't understand is why do they do pre-signup just you for the easy of you. I have _created_ an account just to edit my personal data, that's nonsense!!! If you give your contact info you are allowing this kind of issues, but if you don't... well, you can't use internet if you don't. On Wed, Aug 5, 2009 at 10:56 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 09:54 -0400, Eric Butera wrote: On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ Is there nothing that anybody can actually do about this? Where is the new company based? Are there laws in that country about this sort of thing? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: OutsourcingRoom.com
On Wed, 2009-08-05 at 11:10 -0300, Martin Scotta wrote: Nobody can actually do anything. This happen all the time. Sites like facebook or myspace send invitations to all your mail's contacts, but that's not the problem. What I can't understand is why do they do pre-signup just you for the easy of you. I have _created_ an account just to edit my personal data, that's nonsense!!! If you give your contact info you are allowing this kind of issues, but if you don't... well, you can't use internet if you don't. On Wed, Aug 5, 2009 at 10:56 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 09:54 -0400, Eric Butera wrote: On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ Is there nothing that anybody can actually do about this? Where is the new company based? Are there laws in that country about this sort of thing? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta Nicely said, but doesn't answer the question. Sites like that will send out emails all the time as invites, because they have the permission of whoever they are sending the emails on behalf of, hence why they can access the contacts list. This is a different situation, where the site was hacked, and the company is not only sending out invite links to all the email addresses it found, but it is including other personal information, i.e. the username and password on the original site. Also, as it got that information as a result of hacking, and they are the ones directly using that information, well, they could be in a lot of trouble depending on where in the world they are. Thanks, Ash
Re: [PHP] Warning: OutsourcingRoom.com
On Wed, 2009-08-05 at 15:14 +0100, Ashley Sheridan wrote: On Wed, 2009-08-05 at 11:10 -0300, Martin Scotta wrote: Nobody can actually do anything. This happen all the time. Sites like facebook or myspace send invitations to all your mail's contacts, but that's not the problem. What I can't understand is why do they do pre-signup just you for the easy of you. I have _created_ an account just to edit my personal data, that's nonsense!!! If you give your contact info you are allowing this kind of issues, but if you don't... well, you can't use internet if you don't. On Wed, Aug 5, 2009 at 10:56 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 09:54 -0400, Eric Butera wrote: On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ Is there nothing that anybody can actually do about this? Where is the new company based? Are there laws in that country about this sort of thing? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta Nicely said, but doesn't answer the question. Sites like that will send out emails all the time as invites, because they have the permission of whoever they are sending the emails on behalf of, hence why they can access the contacts list. This is a different situation, where the site was hacked, and the company is not only sending out invite links to all the email addresses it found, but it is including other personal information, i.e. the username and password on the
Re: [PHP] Warning: OutsourcingRoom.com
What we can do is make a Report Web Forgery for this site. If you use Firefox there is an option in the help menu. Also you can report to search engines like Google or Yahoo (that's what I did) well... in this thread we are doing something On Wed, Aug 5, 2009 at 11:14 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 11:10 -0300, Martin Scotta wrote: Nobody can actually do anything. This happen all the time. Sites like facebook or myspace send invitations to all your mail's contacts, but that's not the problem. What I can't understand is why do they do pre-signup just you for the easy of you. I have _created_ an account just to edit my personal data, that's nonsense!!! If you give your contact info you are allowing this kind of issues, but if you don't... well, you can't use internet if you don't. On Wed, Aug 5, 2009 at 10:56 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 09:54 -0400, Eric Butera wrote: On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ Is there nothing that anybody can actually do about this? Where is the new company based? Are there laws in that country about this sort of thing? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta Nicely said, but doesn't answer the question. Sites like that will send out emails all the time as invites, because they have the permission of whoever they are sending the emails on behalf of, hence why they can access the contacts list. This is a different situation, where the site was hacked, and the company is not only sending out invite links to all the email
[PHP] OUCH (RESOLVED)
Thank you all for being so brutally honest, I am doing my best, and yes I do get hung up on syntax errors, I mean who doesn't stare at code looking for a misplaced or missing ; or . For what seems like hours with a boss asking repeatedly is it done, is it done before freaking out and asking for more eyes to help look, so yes I am totally guilty of that, unfortunately I don't work on a team, so I have no one live in person to ask, and my company training consisted of 2 books but no training time as in small projects, just 2 books and big projects. For the record I have asked to be transferred back to graphics/front end production as soon as a full time position opens back up there, I don't seem to have a knack or logic for back end programming wish I did, but like I said in a previous email to Shawn it's very left brained and I'm very right brained. I will do my best to not use the list, and if I do I thank you thank you thank you for the kind heartedness of Ash, Bastian, Jim and even Shawn (who rails me out first) who continue to help me, and to the few others that still find it good karma whose names I may have left off. Good things happen to those who do Good things. Peace and Happy Wednesday Terion -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OUCH (RESOLVED)
... Peace and Happy Wednesday Terion :-) nice! In the end, I imagine that if it was all taken away suddenly and for good, that we'd all miss the real people here more than any of the rules, logics, and practicalities of getting paid work done.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OUCH (RESOLVED)
Terion, I've been sitting in the background watching all this unfold and thought I would chime in. I passed along your all caps email to a co-worker of mine (she programs in FoxPro) and she said she could definitely relate to what you were going through! As for people being honest (especially Shawn), of all the bosses I've had, the one that I respect most was the one that was the hardest on me and, at times, seemingly unfair. But because of her being hard on me I grew. So, hang in there. The more you figure out these problems the better you'll get. Take care, Floyd On Aug 5, 2009, at 11:19 AM, Miller, Terion wrote: Thank you all for being so brutally honest, I am doing my best, and yes I do get hung up on syntax errors, I mean who doesn't stare at code looking for a misplaced or missing ; or . For what seems like hours with a boss asking repeatedly is it done, is it done before freaking out and asking for more eyes to help look, so yes I am totally guilty of that, unfortunately I don't work on a team, so I have no one live in person to ask, and my company training consisted of 2 books but no training time as in small projects, just 2 books and big projects. For the record I have asked to be transferred back to graphics/front end production as soon as a full time position opens back up there, I don't seem to have a knack or logic for back end programming wish I did, but like I said in a previous email to Shawn it's very left brained and I'm very right brained. I will do my best to not use the list, and if I do I thank you thank you thank you for the kind heartedness of Ash, Bastian, Jim and even Shawn (who rails me out first) who continue to help me, and to the few others that still find it good karma whose names I may have left off. Good things happen to those who do Good things. Peace and Happy Wednesday Terion -- 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] Script to Compare Database Structures
I finally got a chance to play with this and it looks like it is exactly what I need. Thanks! On Fri, Jul 31, 2009 at 11:50 PM, German Geekgeek...@gmail.com wrote: have you tried mysqldiff? I want to be able to compare the structure of two different clients databases that might be on different servers that are firewalled away from each other. Given the two structures it will list all the SQL commands needed to make the database structure the same. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Character encoding
On 08/05/2009 07:05 AM, Sándor Tamás (HostWare Kft.) wrote: Hi, I have a mysql database, which the users can insert comments. As the users can be from different countries, with different character encoding, the mysql table can contain various special characters. How can I be sure to display these comments properly? I've found the mb_convert_encoding, and for some characters it works okay, but there are some really special characters which displayed as a '?'. Does anybody know some workarounds? Thanks, SanTa Use UTF-8. Create your database and its tables with UTF-8 char encoding. eg. ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci Note there's no hyphen. Also, make sure the *data* is converted. You can use iconv for that. Next, ensure that the browser knows how to display the text. Use either a header or a meta tag (or both): meta http-equiv=Content-Type content=text/html; charset=utf-8 / This is especially important for the page with the comments form. Any SQL file with your data (for import) should have the following at the top: SET NAMES 'utf8'; If you export a dump make sure that line is present before trying to import. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Character encoding
Build some script to convert to these comments. Check this out: ?php // Fixes the encoding to uf8 function fixEncoding($in_str) { $cur_encoding = mb_detect_encoding($in_str) ; if($cur_encoding == UTF-8 mb_check_encoding($in_str,UTF-8)) return $in_str; else return utf8_encode($in_str); } // fixEncoding ? Regards, Igor Escobar Systems Analyst Interface Designer + http://blog.igorescobar.com + http://www.igorescobar.com + @igorescobar (twitter) 2009/8/5 b p...@logi.ca On 08/05/2009 07:05 AM, Sándor Tamás (HostWare Kft.) wrote: Hi, I have a mysql database, which the users can insert comments. As the users can be from different countries, with different character encoding, the mysql table can contain various special characters. How can I be sure to display these comments properly? I've found the mb_convert_encoding, and for some characters it works okay, but there are some really special characters which displayed as a '?'. Does anybody know some workarounds? Thanks, SanTa Use UTF-8. Create your database and its tables with UTF-8 char encoding. eg. ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci Note there's no hyphen. Also, make sure the *data* is converted. You can use iconv for that. Next, ensure that the browser knows how to display the text. Use either a header or a meta tag (or both): meta http-equiv=Content-Type content=text/html; charset=utf-8 / This is especially important for the page with the comments form. Any SQL file with your data (for import) should have the following at the top: SET NAMES 'utf8'; If you export a dump make sure that line is present before trying to import. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Character encoding
I assume that the comments are collected by a browser form provided by you ! do u use the form attribute accept-charset ? I always do and I always use UTF-8 homogeniously throughout my application I never had that problem. Sándor Tamás (HostWare Kft . ) sandorta...@hostware.hu wrote in message news:9ac01674e03a4d76a1b49dad39b04...@stgepe... Hi, I have a mysql database, which the users can insert comments. As the users can be from different countries, with different character encoding, the mysql table can contain various special characters. How can I be sure to display these comments properly? I've found the mb_convert_encoding, and for some characters it works okay, but there are some really special characters which displayed as a '?'. Does anybody know some workarounds? Thanks, SanTa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Character encoding
On Wed, 5 Aug 2009 18:11:44 +0200, Ralph Deffke wrote: I assume that the comments are collected by a browser form provided by you ! do u use the form attribute accept-charset ? I always do and I always use UTF-8 homogeniously throughout my application I never had that problem. Don't forget to read the late Alan J. Flavell's pages on character sets and internationalization. http://www.alanflavell.org.uk/charset/form-i18n.html http://www.alanflavell.org.uk/charset/ /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] navigation include not functioning
I am trying to generate pages by importing content in includes, and using my navigation include to tell PHP to replace a $thisPage variable which all the includes use ?php include('phpincludes/' . $thisPage . '.php') ? The idea behind it (I know tons of people do it, but I'm new to this concept), is to have a 'layout' page where only a variable changes using $_GET on an href (index.php?page=services or index.php?page=about) to load the new 'pages'. PROBLEM: All my links are displaying the current page state, and links are not building around the link text (hrefs are built conditionally with if $thisPage != services then build the link, otherwise leave it as normal text). Same thing with the background image behind the link text (to indicate a page's current position). If the condition is not true, all the links (except the true current 'page') are supposed reload index.php and pass a variable to itself to place into $thisPage using href=index.php?page= (after which I have a variable which stores about or services within the if statement near the link text. If this sounds like something you are familiar with (former issues and whatnot) please let me know what I'm doing wrong. I would be happy to give you any code you want to look at (index.php or navigation.php, whatever). Thanks again for your help PHP gurus!
Re: [PHP] navigation include not functioning
I'm having trouble understanding your description of the problem. Can you tell us what you're seeing and what you expect to see? Jerry Wilborn jerrywilb...@gmail.com On Wed, Aug 5, 2009 at 12:00 PM, Allen McCabe allenmcc...@gmail.com wrote: I am trying to generate pages by importing content in includes, and using my navigation include to tell PHP to replace a $thisPage variable which all the includes use ?php include('phpincludes/' . $thisPage . '.php') ? The idea behind it (I know tons of people do it, but I'm new to this concept), is to have a 'layout' page where only a variable changes using $_GET on an href (index.php?page=services or index.php?page=about) to load the new 'pages'. PROBLEM: All my links are displaying the current page state, and links are not building around the link text (hrefs are built conditionally with if $thisPage != services then build the link, otherwise leave it as normal text). Same thing with the background image behind the link text (to indicate a page's current position). If the condition is not true, all the links (except the true current 'page') are supposed reload index.php and pass a variable to itself to place into $thisPage using href=index.php?page= (after which I have a variable which stores about or services within the if statement near the link text. If this sounds like something you are familiar with (former issues and whatnot) please let me know what I'm doing wrong. I would be happy to give you any code you want to look at (index.php or navigation.php, whatever). Thanks again for your help PHP gurus!
Re: [PHP] navigation include not functioning
Sure. When I load my site, default.php loads ( displaying: http://uplinkdesign.hostzi.com/ in the browser as expected). $thisPage is set to about via: ?php if (!isset($thisPage)) { $thisPage=about; } else { $thisPage = addslashes($_GET['page']); } ? in the head tags. I am seeing this: The first 2 includes work just fine, loading to proper middle section and proper right-hand-side page content, the navigation include also loads, but all the of tabs (background images) are the currentpage image, as opposed to not, as they should be (the the exception of the About Us background image). It seems that $thisPage is equal to all four values, so all the if statements within navigation tell PHP to load the current page image for all 4 links. Does this help? On Wed, Aug 5, 2009 at 10:10 AM, Jerry Wilborn jerrywilb...@gmail.comwrote: I'm having trouble understanding your description of the problem. Can you tell us what you're seeing and what you expect to see? Jerry Wilborn jerrywilb...@gmail.com On Wed, Aug 5, 2009 at 12:00 PM, Allen McCabe allenmcc...@gmail.comwrote: I am trying to generate pages by importing content in includes, and using my navigation include to tell PHP to replace a $thisPage variable which all the includes use ?php include('phpincludes/' . $thisPage . '.php') ? The idea behind it (I know tons of people do it, but I'm new to this concept), is to have a 'layout' page where only a variable changes using $_GET on an href (index.php?page=services or index.php?page=about) to load the new 'pages'. PROBLEM: All my links are displaying the current page state, and links are not building around the link text (hrefs are built conditionally with if $thisPage != services then build the link, otherwise leave it as normal text). Same thing with the background image behind the link text (to indicate a page's current position). If the condition is not true, all the links (except the true current 'page') are supposed reload index.php and pass a variable to itself to place into $thisPage using href=index.php?page= (after which I have a variable which stores about or services within the if statement near the link text. If this sounds like something you are familiar with (former issues and whatnot) please let me know what I'm doing wrong. I would be happy to give you any code you want to look at (index.php or navigation.php, whatever). Thanks again for your help PHP gurus!
Re: [PHP] navigation include not functioning
I think you are looking for something like this: $page = array_key_exists( 'page', $_GET ) ? GET['page'] : 'index'; Then you MUST sanitize the $page variable. I often use the querystring to wrapp the module you are requesting: www.example.org/?path/to/molude (note that .htaccess is required) # the you can access by echo $path = $_SERVER['QUERY_STRING']; On Wed, Aug 5, 2009 at 2:19 PM, Allen McCabeallenmcc...@gmail.com wrote: Sure. When I load my site, default.php loads ( displaying: http://uplinkdesign.hostzi.com/ in the browser as expected). $thisPage is set to about via: ?php if (!isset($thisPage)) { $thisPage=about; } else { $thisPage = addslashes($_GET['page']); } ? in the head tags. I am seeing this: The first 2 includes work just fine, loading to proper middle section and proper right-hand-side page content, the navigation include also loads, but all the of tabs (background images) are the currentpage image, as opposed to not, as they should be (the the exception of the About Us background image). It seems that $thisPage is equal to all four values, so all the if statements within navigation tell PHP to load the current page image for all 4 links. Does this help? On Wed, Aug 5, 2009 at 10:10 AM, Jerry Wilborn jerrywilb...@gmail.comwrote: I'm having trouble understanding your description of the problem. Can you tell us what you're seeing and what you expect to see? Jerry Wilborn jerrywilb...@gmail.com On Wed, Aug 5, 2009 at 12:00 PM, Allen McCabe allenmcc...@gmail.comwrote: I am trying to generate pages by importing content in includes, and using my navigation include to tell PHP to replace a $thisPage variable which all the includes use ?php include('phpincludes/' . $thisPage . '.php') ? The idea behind it (I know tons of people do it, but I'm new to this concept), is to have a 'layout' page where only a variable changes using $_GET on an href (index.php?page=services or index.php?page=about) to load the new 'pages'. PROBLEM: All my links are displaying the current page state, and links are not building around the link text (hrefs are built conditionally with if $thisPage != services then build the link, otherwise leave it as normal text). Same thing with the background image behind the link text (to indicate a page's current position). If the condition is not true, all the links (except the true current 'page') are supposed reload index.php and pass a variable to itself to place into $thisPage using href=index.php?page= (after which I have a variable which stores about or services within the if statement near the link text. If this sounds like something you are familiar with (former issues and whatnot) please let me know what I'm doing wrong. I would be happy to give you any code you want to look at (index.php or navigation.php, whatever). Thanks again for your help PHP gurus! -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] navigation include not functioning
On Wed, 05 Aug 2009 20:19:00 +0300, Allen McCabe allenmcc...@gmail.com wrote: Sure. When I load my site, default.php loads ( displaying: http://uplinkdesign.hostzi.com/ in the browser as expected). $thisPage is set to about via: ?php if (!isset($thisPage)) { $thisPage=about; } else { $thisPage = addslashes($_GET['page']); } ? in the head tags. I am seeing this: The first 2 includes work just fine, loading to proper middle section and proper right-hand-side page content, the navigation include also loads, but all the of tabs (background images) are the currentpage image, as opposed to not, as they should be (the the exception of the About Us background image). It seems that $thisPage is equal to all four values, so all the if statements within navigation tell PHP to load the current page image for all 4 links. Does this help? Looks like you need something like that: $pages = array( // list of modules you have, for example: 'about' , 'help', etc ); $page = isset($_GET['page']) isset($pages[$_GET['page']]) ? $_GET['page'] : 'about'; // about is default page here then just: include 'modules/'.$page.'.php'; Always remember that you have to check what is included. Best approach(if possible) to have a predefined list of all modules which can be included. Else, there is some nasty things like: ?page=../index.php (infinity recurssion) ?page=http://otherhost.com/hacker. (inclusion of malicious script) and so on. On Wed, Aug 5, 2009 at 10:10 AM, Jerry Wilborn jerrywilb...@gmail.comwrote: Look I'm having trouble understanding your description of the problem. Can you tell us what you're seeing and what you expect to see? Jerry Wilborn jerrywilb...@gmail.com On Wed, Aug 5, 2009 at 12:00 PM, Allen McCabe allenmcc...@gmail.comwrote: I am trying to generate pages by importing content in includes, and using my navigation include to tell PHP to replace a $thisPage variable which all the includes use ?php include('phpincludes/' . $thisPage . '.php') ? The idea behind it (I know tons of people do it, but I'm new to this concept), is to have a 'layout' page where only a variable changes using $_GET on an href (index.php?page=services or index.php?page=about) to load the new 'pages'. PROBLEM: All my links are displaying the current page state, and links are not building around the link text (hrefs are built conditionally with if $thisPage != services then build the link, otherwise leave it as normal text). Same thing with the background image behind the link text (to indicate a page's current position). If the condition is not true, all the links (except the true current 'page') are supposed reload index.php and pass a variable to itself to place into $thisPage using href=index.php?page= (after which I have a variable which stores about or services within the if statement near the link text. If this sounds like something you are familiar with (former issues and whatnot) please let me know what I'm doing wrong. I would be happy to give you any code you want to look at (index.php or navigation.php, whatever). Thanks again for your help PHP gurus! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Time keeping in DB
So, obviously not PHP related, but I'm looking for thoughts on the best way to record time sheets in a DB. A time sheet for hours worked per day, not like a time clock where you start and stop. The two possibilities that I have thought of are (these are simplistic, of course I'll be storing references to the user, the project code etc.): 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5, d6, d7) where the dX field holds the hours worked 2. One record for each day (date, hours) -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Time keeping in DB
On Wed, 2009-08-05 at 14:18 -0500, Shawn McKenzie wrote: So, obviously not PHP related, but I'm looking for thoughts on the best way to record time sheets in a DB. A time sheet for hours worked per day, not like a time clock where you start and stop. The two possibilities that I have thought of are (these are simplistic, of course I'll be storing references to the user, the project code etc.): 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5, d6, d7) where the dX field holds the hours worked 2. One record for each day (date, hours) -- Thanks! -Shawn http://www.spidean.com I'd go with a record per timesheet, so you might end up with more than one timesheet per day. That way, it's just simple SQL to find out how many hours you've worked on one day, or on one job, etc. Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Time keeping in DB
You don't mention what DB you're using, but mySQL can be quite a pain when dealing with multiple time zones. Not impossible, but a hassle none the less. Be sure to set aside a place to store this (and another spot for user preferences to keep track of their TZ). Jerry Wilborn jerrywilb...@gmail.com On Wed, Aug 5, 2009 at 2:20 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Wed, 2009-08-05 at 14:18 -0500, Shawn McKenzie wrote: So, obviously not PHP related, but I'm looking for thoughts on the best way to record time sheets in a DB. A time sheet for hours worked per day, not like a time clock where you start and stop. The two possibilities that I have thought of are (these are simplistic, of course I'll be storing references to the user, the project code etc.): 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5, d6, d7) where the dX field holds the hours worked 2. One record for each day (date, hours) -- Thanks! -Shawn http://www.spidean.com I'd go with a record per timesheet, so you might end up with more than one timesheet per day. That way, it's just simple SQL to find out how many hours you've worked on one day, or on one job, etc. Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Time keeping in DB
Shawn McKenzie nos...@mckenzies.net wrote: So, obviously not PHP related, but I'm looking for thoughts on the best way to record time sheets in a DB. A time sheet for hours worked per day, not like a time clock where you start and stop. The two possibilities that I have thought of are (these are simplistic, of course I'll be storing references to the user, the project code etc.): 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5, d6, d7) where the dX field holds the hours worked 2. One record for each day (date, hours) -- Thanks! -Shawn http://www.spidean.com Depends on what you are looking to do.. Are you also needing to keep whether or not a specific project? If it is regular time/Overtime? It may be easier to set the database up: user,week,day,project,hours,type Then you can query the info/user off that, it should allow you to expand as needed. HTH, Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Time keeping in DB
On Wed, 05 Aug 2009 22:18:31 +0300, Shawn McKenzie nos...@mckenzies.net wrote: So, obviously not PHP related, but I'm looking for thoughts on the best way to record time sheets in a DB. A time sheet for hours worked per day, not like a time clock where you start and stop. The two possibilities that I have thought of are (these are simplistic, of course I'll be storing references to the user, the project code etc.): 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5, d6, d7) where the dX field holds the hours worked 2. One record for each day (date, hours) In simpliest scenarios, it is better to use first approach. it is best in terms of simplicity, usage, space consumption. in case if you need to store extra information about hours (at which location, at which time started, etc, ), then it might be better to split it to following tbles: 1. Time sheet. All basic information about sheet: user, year, week number, etc. whatever you need. Just add unique id of this timesheet Here you can also add cached version of hours per day. 2. Day information: timesheetId, dayId(1-7), hours, a lot of extra fields for this day. Of course, this is applicable only if you have a lot of extra information for each day. If not, then use easiet approach. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Time keeping in DB
sorry man, but a good data design keeps only data in a table u can not calculate. in ur case that would be only date start and end time. refernces to user and project/tasks in other tables. ur time sheet is definately a job for a report. that type of design limits u to nothing. a user can start ans stop as many times he wants a day or time range. u can report any number of time bits to any number of project a day or time range Ralph Shawn McKenzie nos...@mckenzies.net wrote in message news:5e.47.03459.7ead9...@pb1.pair.com... So, obviously not PHP related, but I'm looking for thoughts on the best way to record time sheets in a DB. A time sheet for hours worked per day, not like a time clock where you start and stop. The two possibilities that I have thought of are (these are simplistic, of course I'll be storing references to the user, the project code etc.): 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5, d6, d7) where the dX field holds the hours worked 2. One record for each day (date, hours) -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] navigation include not functioning
Okay, I see how href=?page=contact would work, and I do indeed have only one file (which loads includes), but it still is not working. Clicking a link, be href=?page=contact, href=?page=services, whatever, it still loads the page with the ?page=whatever attached to the URL, but it is not subsituting the $page variable within the include snippets, and it just loads the 'about' versions of all includes (/phpincludes/about_content.php as opposed to /phpincludes/services_content.php or whichever). This is really stumping me and try as I might I cannot see why it will not work. Here is some of my code as it is currently: On default.php: [code=default.php] html head ?php $pages = array( // list of includes: 'about' , 'services', 'portfolio', 'contact' ); $page = isset($_GET['page']) isset($pages[$_GET['page']]) ? $_GET['page'] : 'about'; // about is default page here ? title [/code] then in the body tags [code=default.php] td?php include('phpincludes/' . $page . '_centerbar.php'); ?/td /tr ?php include('phpincludes/nav2.php'); ? tr [/code] [code=nav2.php] a href=?page=servicesSERVICES/a [/code] It is surprisingly little code and I am starting to wonder if any php settings on my server are inhibiting this. What do you think? 2009/8/5 ollisso olli...@fromru.com On Wed, 05 Aug 2009 22:08:30 +0300, Allen McCabe allenmcc...@gmail.com wrote: You can do something like that: links: a href='?page=contact'Contact/a This will work if you have only one file, all the time and it is default one for current folder. (normally that is index.php, might be default.php in your case) Second option is to use more harder approach: $pos= min(strpos($_SERVER['QUERY_STRING'],''),strpos($_SERVER['QUERY_STRING'],'=')); $act= ($pos!==false) ? substr($_SERVER['QUERY_STRING'], 0, $pos) : $_SERVER['QUERY_STRING']; $page = strtolower($act); then you can use links like: href='?contact' or if you need: href='?contact=1' (in case of GET forms) Third option is to use mod_rewrite, but this is slightly harder :) But then you will be able to use links like: www.domain.com/contact/ (which will work like: index.php?page=contact internally) About checking what is included: Imagine following scenario: $page = isset($_GET['page']) ? $_GET['page'] : 'about'; include 'modules/'.$page.'.php'; Problem here is that you can include ANY file. For example: ?page=../index will work as: include 'modules/../index.php'; Which is crearly not what is intended. There is also much more dangerous scenarios of this. I hope this explains something :) Excellent, your snippet is working nicely. Thank you! Unfortunately, when I click a link ( a href= http://uplinkdesign.hostzi.com/default.php?page=contact; ), deafult.php?contact shows in the browser, but the default (about) content is loading. Also, I don't know what you mean by checking what is included. 2009/8/5 ollisso olli...@fromru.com On Wed, 05 Aug 2009 20:19:00 +0300, Allen McCabe allenmcc...@gmail.com wrote: Sure. When I load my site, default.php loads ( displaying: http://uplinkdesign.hostzi.com/ in the browser as expected). $thisPage is set to about via: ?php if (!isset($thisPage)) { $thisPage=about; } else { $thisPage = addslashes($_GET['page']); } ? in the head tags. I am seeing this: The first 2 includes work just fine, loading to proper middle section and proper right-hand-side page content, the navigation include also loads, but all the of tabs (background images) are the currentpage image, as opposed to not, as they should be (the the exception of the About Us background image). It seems that $thisPage is equal to all four values, so all the if statements within navigation tell PHP to load the current page image for all 4 links. Does this help? Looks like you need something like that: $pages = array( // list of modules you have, for example: 'about' , 'help', etc ); $page = isset($_GET['page']) isset($pages[$_GET['page']]) ? $_GET['page'] : 'about'; // about is default page here then just: include 'modules/'.$page.'.php'; Always remember that you have to check what is included. Best approach(if possible) to have a predefined list of all modules which can be included. Else, there is some nasty things like: ?page=../index.php (infinity recurssion) ?page=http://otherhost.com/hacker. (inclusion of malicious script) and so on. On Wed, Aug 5, 2009 at 10:10 AM, Jerry Wilborn jerrywilb...@gmail.com wrote: Look I'm having trouble understanding your description of the problem. Can you tell us what you're seeing and what you expect to see? Jerry Wilborn jerrywilb...@gmail.com On Wed, Aug 5, 2009 at 12:00 PM, Allen McCabe allenmcc...@gmail.com wrote: I am trying to generate pages by importing content in includes, and using my navigation include to tell PHP to replace a $thisPage variable which all the includes use
Re: [PHP] navigation include not functioning
You are using a value-filled array as a key-filled. Try this snippet and look the results... $pages = array('about' , 'services', 'portfolio', 'contact'); $page = array_key_exists( 'page', $_GET ) ? $_GET[ 'page' ] : 'about'; /*if*/ false === array_search( $page, $pages, true ) ( $page = 'about' ); # note the sintax used to avoid if-statement # this has the same behaviour, but with less performance $pages = array('about' , 'services', 'portfolio', 'contact'); $page = array_key_exists( 'page', $_GET ) ? $_GET[ 'page' ] : 'about'; if( false === array_search( $page, $pages, true )) { $page = 'about'; } On Wed, Aug 5, 2009 at 5:36 PM, Allen McCabeallenmcc...@gmail.com wrote: Okay, I see how href=?page=contact would work, and I do indeed have only one file (which loads includes), but it still is not working. Clicking a link, be href=?page=contact, href=?page=services, whatever, it still loads the page with the ?page=whatever attached to the URL, but it is not subsituting the $page variable within the include snippets, and it just loads the 'about' versions of all includes (/phpincludes/about_content.php as opposed to /phpincludes/services_content.php or whichever). This is really stumping me and try as I might I cannot see why it will not work. Here is some of my code as it is currently: On default.php: [code=default.php] html head ?php $pages = array( // list of includes: 'about' , 'services', 'portfolio', 'contact' ); $page = isset($_GET['page']) isset($pages[$_GET['page']]) ? $_GET['page'] : 'about'; // about is default page here ? title [/code] then in the body tags [code=default.php] td?php include('phpincludes/' . $page . '_centerbar.php'); ?/td /tr ?php include('phpincludes/nav2.php'); ? tr [/code] [code=nav2.php] a href=?page=servicesSERVICES/a [/code] It is surprisingly little code and I am starting to wonder if any php settings on my server are inhibiting this. What do you think? 2009/8/5 ollisso olli...@fromru.com On Wed, 05 Aug 2009 22:08:30 +0300, Allen McCabe allenmcc...@gmail.com wrote: You can do something like that: links: a href='?page=contact'Contact/a This will work if you have only one file, all the time and it is default one for current folder. (normally that is index.php, might be default.php in your case) Second option is to use more harder approach: $pos = min(strpos($_SERVER['QUERY_STRING'],''),strpos($_SERVER['QUERY_STRING'],'=')); $act = ($pos!==false) ? substr($_SERVER['QUERY_STRING'], 0, $pos) : $_SERVER['QUERY_STRING']; $page = strtolower($act); then you can use links like: href='?contact' or if you need: href='?contact=1' (in case of GET forms) Third option is to use mod_rewrite, but this is slightly harder :) But then you will be able to use links like: www.domain.com/contact/ (which will work like: index.php?page=contact internally) About checking what is included: Imagine following scenario: $page = isset($_GET['page']) ? $_GET['page'] : 'about'; include 'modules/'.$page.'.php'; Problem here is that you can include ANY file. For example: ?page=../index will work as: include 'modules/../index.php'; Which is crearly not what is intended. There is also much more dangerous scenarios of this. I hope this explains something :) Excellent, your snippet is working nicely. Thank you! Unfortunately, when I click a link ( a href= http://uplinkdesign.hostzi.com/default.php?page=contact; ), deafult.php?contact shows in the browser, but the default (about) content is loading. Also, I don't know what you mean by checking what is included. 2009/8/5 ollisso olli...@fromru.com On Wed, 05 Aug 2009 20:19:00 +0300, Allen McCabe allenmcc...@gmail.com wrote: Sure. When I load my site, default.php loads ( displaying: http://uplinkdesign.hostzi.com/ in the browser as expected). $thisPage is set to about via: ?php if (!isset($thisPage)) { $thisPage=about; } else { $thisPage = addslashes($_GET['page']); } ? in the head tags. I am seeing this: The first 2 includes work just fine, loading to proper middle section and proper right-hand-side page content, the navigation include also loads, but all the of tabs (background images) are the currentpage image, as opposed to not, as they should be (the the exception of the About Us background image). It seems that $thisPage is equal to all four values, so all the if statements within navigation tell PHP to load the current page image for all 4 links. Does this help? Looks like you need something like that: $pages = array( // list of modules you have, for example: 'about' , 'help', etc ); $page = isset($_GET['page']) isset($pages[$_GET['page']]) ? $_GET['page'] : 'about'; // about is default page here then just: include 'modules/'.$page.'.php'; Always remember that you have to check what is included. Best approach(if possible) to have a
Re: [PHP] navigation include not functioning (RESOLVED)
I just wanted to let know I figured out my last issue (last as in, for now). In my navigation.php include file, I had if ($page = about) echo href I changed it to if ($page == about) echo and it suddenly worked! Imagine that... Thanks all for you help, you are celebrities in my book now. On Wed, Aug 5, 2009 at 1:44 PM, Martin Scotta martinsco...@gmail.comwrote: You are using a value-filled array as a key-filled. Try this snippet and look the results... $pages = array('about' , 'services', 'portfolio', 'contact'); $page = array_key_exists( 'page', $_GET ) ? $_GET[ 'page' ] : 'about'; /*if*/ false === array_search( $page, $pages, true ) ( $page = 'about' ); # note the sintax used to avoid if-statement # this has the same behaviour, but with less performance $pages = array('about' , 'services', 'portfolio', 'contact'); $page = array_key_exists( 'page', $_GET ) ? $_GET[ 'page' ] : 'about'; if( false === array_search( $page, $pages, true )) { $page = 'about'; } On Wed, Aug 5, 2009 at 5:36 PM, Allen McCabeallenmcc...@gmail.com wrote: Okay, I see how href=?page=contact would work, and I do indeed have only one file (which loads includes), but it still is not working. Clicking a link, be href=?page=contact, href=?page=services, whatever, it still loads the page with the ?page=whatever attached to the URL, but it is not subsituting the $page variable within the include snippets, and it just loads the 'about' versions of all includes (/phpincludes/about_content.php as opposed to /phpincludes/services_content.php or whichever). This is really stumping me and try as I might I cannot see why it will not work. Here is some of my code as it is currently: On default.php: [code=default.php] html head ?php $pages = array( // list of includes: 'about' , 'services', 'portfolio', 'contact' ); $page = isset($_GET['page']) isset($pages[$_GET['page']]) ? $_GET['page'] : 'about'; // about is default page here ? title [/code] then in the body tags [code=default.php] td?php include('phpincludes/' . $page . '_centerbar.php'); ?/td /tr ?php include('phpincludes/nav2.php'); ? tr [/code] [code=nav2.php] a href=?page=servicesSERVICES/a [/code] It is surprisingly little code and I am starting to wonder if any php settings on my server are inhibiting this. What do you think? 2009/8/5 ollisso olli...@fromru.com On Wed, 05 Aug 2009 22:08:30 +0300, Allen McCabe allenmcc...@gmail.com wrote: You can do something like that: links: a href='?page=contact'Contact/a This will work if you have only one file, all the time and it is default one for current folder. (normally that is index.php, might be default.php in your case) Second option is to use more harder approach: $pos= min(strpos($_SERVER['QUERY_STRING'],''),strpos($_SERVER['QUERY_STRING'],'=')); $act= ($pos!==false) ? substr($_SERVER['QUERY_STRING'], 0, $pos) : $_SERVER['QUERY_STRING']; $page = strtolower($act); then you can use links like: href='?contact' or if you need: href='?contact=1' (in case of GET forms) Third option is to use mod_rewrite, but this is slightly harder :) But then you will be able to use links like: www.domain.com/contact/ (which will work like: index.php?page=contact internally) About checking what is included: Imagine following scenario: $page = isset($_GET['page']) ? $_GET['page'] : 'about'; include 'modules/'.$page.'.php'; Problem here is that you can include ANY file. For example: ?page=../index will work as: include 'modules/../index.php'; Which is crearly not what is intended. There is also much more dangerous scenarios of this. I hope this explains something :) Excellent, your snippet is working nicely. Thank you! Unfortunately, when I click a link ( a href= http://uplinkdesign.hostzi.com/default.php?page=contact; ), deafult.php?contact shows in the browser, but the default (about) content is loading. Also, I don't know what you mean by checking what is included. 2009/8/5 ollisso olli...@fromru.com On Wed, 05 Aug 2009 20:19:00 +0300, Allen McCabe allenmcc...@gmail.com wrote: Sure. When I load my site, default.php loads ( displaying: http://uplinkdesign.hostzi.com/ in the browser as expected). $thisPage is set to about via: ?php if (!isset($thisPage)) { $thisPage=about; } else { $thisPage = addslashes($_GET['page']); } ? in the head tags. I am seeing this: The first 2 includes work just fine, loading to proper middle section and proper right-hand-side page content, the navigation include also loads, but all the of tabs (background images) are the currentpage image, as opposed to not, as they should be (the the exception of the About Us background image). It seems that
[PHP] Re: Time keeping in DB
sorry man, but a good data design keeps only data in a table u can not calculate. in ur case that would be only date start and end time. refernces to user and project/tasks in other tables. ur time sheet is definately a job for a report. that type of design limits u to nothing. a user can start ans stop as many times he wants a day or time range. u can report any number of time bits to any number of project a day or time range I agree (unless the app just doesn't have access to the start/stop data). Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamically naming PHP vars on the fly?
You can use variable variables ?php $nombre = 'Martin'; $name = 'nombre'; echo $$name; # === Martin You can make more complicated statements with this technique. $var1 = 'apple'; ${ 'Fruit_' . $var1 } = 'organic'; echo $Fruit_apple; // here you are When your statements are complex use the ${ statement } syntax. I often use this for hidden global variables. ${ 'try to use this variable directly' } = 'something'; print_r( get_defined_vars() ); # [try to use this variable directly] = something On Wed, Aug 5, 2009 at 7:17 PM, Govindagovinda.webdnat...@gmail.com wrote: HI all One thing I have been working around but now would love to just do it finally (and save workaround/longer code hassle) is when: I need to be able to create a variable (name it, and assign it a value) whose name is built up from a fixed string concatenated with another string which comes from the value of another (already set) variable. Ie: I want to do this: (I am just assuming it won't work; I haven't even tried it yet) $var1='apple'; $Fruit_$var1=organic; echo $Fruit_apple; // I want this to return organic Or how are you guys dynamically naming PHP vars on the fly? John Butler (Govinda) govinda.webdnat...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamically naming PHP vars on the fly?
http://us2.php.net/manual/en/language.variables.variable.php Jerry Wilborn jerrywilb...@gmail.com On Wed, Aug 5, 2009 at 5:17 PM, Govinda govinda.webdnat...@gmail.comwrote: HI all One thing I have been working around but now would love to just do it finally (and save workaround/longer code hassle) is when: I need to be able to create a variable (name it, and assign it a value) whose name is built up from a fixed string concatenated with another string which comes from the value of another (already set) variable. Ie: I want to do this: (I am just assuming it won't work; I haven't even tried it yet) $var1='apple'; $Fruit_$var1=organic; echo $Fruit_apple; // I want this to return organic Or how are you guys dynamically naming PHP vars on the fly? John Butler (Govinda) govinda.webdnat...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: dynamically naming PHP vars on the fly?
u can dynamical chosse a variable name with a variable using a douple $ charachter eg. $a = this is a: $b = a; echo $$b; outputs this is a this is an all open feature to u have fun ralph Govinda govinda.webdnat...@gmail.com wrote in message news:a215e849-2602-4cb3-9da7-718ff047a...@gmail.com... HI all One thing I have been working around but now would love to just do it finally (and save workaround/longer code hassle) is when: I need to be able to create a variable (name it, and assign it a value) whose name is built up from a fixed string concatenated with another string which comes from the value of another (already set) variable. Ie: I want to do this: (I am just assuming it won't work; I haven't even tried it yet) $var1='apple'; $Fruit_$var1=organic; echo $Fruit_apple; // I want this to return organic Or how are you guys dynamically naming PHP vars on the fly? John Butler (Govinda) govinda.webdnat...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Time keeping in DB
Ben Dunlap wrote: sorry man, but a good data design keeps only data in a table u can not calculate. in ur case that would be only date start and end time. refernces to user and project/tasks in other tables. ur time sheet is definately a job for a report. that type of design limits u to nothing. a user can start ans stop as many times he wants a day or time range. u can report any number of time bits to any number of project a day or time range I agree (unless the app just doesn't have access to the start/stop data). Ben OK, I think I understand most points except the start and stop time. Every time sheet I have used, SAP and several other smaller ones, I enter a weeks worth of time data like: Project Sun Mon TuesWed ThurFri Sat --- Grill steaks8 8 8 8 0 Vacation0 0 0 0 8 So why wouldn't I store the dates and the hours instead of start and stop times? -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Time keeping in DB
OK, I think I understand most points except the start and stop time. Every time sheet I have used, SAP and several other smaller ones, I enter a weeks worth of time data like: Project Sun Mon TuesWed ThurFri Sat --- Grill steaks 8 8 8 8 0 Vacation 0 0 0 0 8 So why wouldn't I store the dates and the hours instead of start and stop times? Maybe it comes down to what the users of the app prefer (or what you prefer, if you're building this app for yourself). From a user's perspective, I like start/stop data-entry better. I love that I can do this in Freshbooks, for example -- just click 'start' and then later click 'stop', 'log hours' -- and I never have to think about things like how many hours are there between 11:26am and 2:12pm? I think Ralph's point was that start/stop data is about as granular as any sort of time-keeping data gets, so if you store only start/stop data, you have ultimate flexibility in the way you can manipulate that data in your app. And it's probably a reasonable generalization that the most forward-looking database designs will store data in as simple and raw a form as possible. Or as Ralph put it, a good data design keeps only data in a table u can not calculate. With start/stop data, you could create weekly timesheets like the one above, in PHP -- and you could also figure out how many hours you log before noon, on average, etc. On the other hand, if the simplest data you enter is already the implicit result of a calculation (stop_time - start_time), you've limited the flexibility of your app from the get-go. But maybe that limitation isn't significant for the app you're building. Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Time keeping in DB
as I said, the job is to store a time sheet. u came up with: 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5, d6, d7) where the dX field holds the hours worked 2. One record for each day (date, hours) it seems that just the first record is fine. in a data design u dont hold the same data twice. so why to use the second record? if u want to use two tables, then the d1-d7 fields should not be in that record. if u use the second record it could be that there are two records with the same date, what to do with it?, whichone is valid? date-time field are a bit complicated and it is not a good idear to do them unique, that is because internally those field are stored in databases as long unsigned integer often the passed seconds since 1982 (the birth of the ibm pc) or even miliseconds. that means there is always internally a big juggling to format the date. Ralph ralph_def...@yahoo.de Shawn McKenzie nos...@mckenzies.net wrote in message news:e9.66.14714.5b80a...@pb1.pair.com... Ben Dunlap wrote: sorry man, but a good data design keeps only data in a table u can not calculate. in ur case that would be only date start and end time. refernces to user and project/tasks in other tables. ur time sheet is definately a job for a report. that type of design limits u to nothing. a user can start ans stop as many times he wants a day or time range. u can report any number of time bits to any number of project a day or time range I agree (unless the app just doesn't have access to the start/stop data). Ben OK, I think I understand most points except the start and stop time. Every time sheet I have used, SAP and several other smaller ones, I enter a weeks worth of time data like: Project Sun Mon Tues Wed Thur Fri Sat --- Grill steaks 8 8 8 8 0 Vacation 0 0 0 0 8 So why wouldn't I store the dates and the hours instead of start and stop times? -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP programming strategy
On Wed, 5 Aug 2009 09:25:20 -0400, phps...@gmail.com (Bastien Koert) wrote: On Wed, Aug 5, 2009 at 8:02 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 21:49 +1000, Clancy wrote: Thank you to all of you who have commented on this query. On the subject of comments, I feel that Larry Garfield settled this query by pointing out that halving the size of a particular document gave a barely noticeable increase in speed. Paul Foster pointed out the problem of maintenance, but if, as I do, you do your development in-house, and then upload the working copies of the program, it would be possible to strip out comments when you upload it. If you were really paranoid, this could have the advantage that if somebody managed to steal your code from the server it would be that much harder for them to understand. On the other hand the process of stripping out the comments could potentially introduce new bugs, and I think this consideration would outweigh anything else. I have recently come to the conclusion that I should never consider anything completed until I have analysed the HTML code for an actual page. It is amazing how badly mangled tables and the like can be without producing any visible effect on the page, and on several occasions I have found PHP error messages which were mixed up with the HTML in such a way that they were not displayed at all. On at least one occasion this gave me the clue to an otherwise baffling bug. I have also discovered that the process of analysing the HTML is made substantially simpler by inserting HTML comments into the output; e.g. instead of Echo '/td/tr/table/td/tr/table'; write ? /td/tr/table !-End of table 2 ' /td/tr/table !-End of table 1 ' Unfortunately, for HTML readability, it is highly desirable not to indent the code, and if you are trying to have nicely indented braces, this makes the PHP code that much harder to interpret. And on the question of functions there is some virtue (primarily from the point of view of maintenance) in not having individual files too large, so while it seems to be the general consensus that splitting up functions into groups to give smaller files will probably slow things down a bit, if they can be grouped into sets which are only loaded in particular circumstances this would be worth doing. Nested tables are the devils playthings! I must be the devil, then. I enjoy playing with them. And if they're done right they seem to work on every system I have tried them on. Granted Dreamweaver design mode gets its knickers in a knot if you nest them more than about 4 deep. Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I would agree there...we have an app that allows users to create forms dynamically with a left and right panel section along with some full width plug-in. At a minimum this is built with three nested tables. Here's the really rotten part, the VP (original dev for the display code) screwed a table close up somewhere. A bug they found literally minutes before it when to prod at a client site, instead of giving me 15 minutes to trace it down, they wrapped the entire table structure in another table to make it look pretty. Clearly he didn't verify the HTML before he released the original version. ;-) Drives me mental as it produces lots a visual screw up when a certain pattern in the form elements is created That's the joy of HTML errors - often the output will appear normal until you make some minor, and apparently irrelevant, change, when it all goes haywire. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamically naming PHP vars on the fly?
You can use variable variables ... You can make more complicated statements with this technique. $var1 = 'apple'; ${ 'Fruit_' . $var1 } = 'organic'; echo $Fruit_apple; // here you are thank you all 3, for your help! That was just what I wanted! -Govinda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Time keeping in DB
Ralph Deffke wrote: as I said, the job is to store a time sheet. u came up with: 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5, d6, d7) where the dX field holds the hours worked 2. One record for each day (date, hours) it seems that just the first record is fine. in a data design u dont hold the same data twice. so why to use the second record? if u want to use two tables, then the d1-d7 fields should not be in that record. if u use the second record it could be that there are two records with the same date, what to do with it?, whichone is valid? date-time field are a bit complicated and it is not a good idear to do them unique, that is because internally those field are stored in databases as long unsigned integer often the passed seconds since 1982 (the birth of the ibm pc) or even miliseconds. that means there is always internally a big juggling to format the date. Ralph ralph_def...@yahoo.de Shawn McKenzie nos...@mckenzies.net wrote in message news:e9.66.14714.5b80a...@pb1.pair.com... Ben Dunlap wrote: sorry man, but a good data design keeps only data in a table u can not calculate. in ur case that would be only date start and end time. refernces to user and project/tasks in other tables. ur time sheet is definately a job for a report. that type of design limits u to nothing. a user can start ans stop as many times he wants a day or time range. u can report any number of time bits to any number of project a day or time range I agree (unless the app just doesn't have access to the start/stop data). Ben OK, I think I understand most points except the start and stop time. Every time sheet I have used, SAP and several other smaller ones, I enter a weeks worth of time data like: Project Sun Mon Tues Wed Thur Fri Sat --- Grill steaks 8 8 8 8 0 Vacation 0 0 0 0 8 So why wouldn't I store the dates and the hours instead of start and stop times? -- Thanks! -Shawn http://www.spidean.com In my original post I said those were the two options, so I would choose 1 or 2 or something else. Not both. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Time keeping in DB
Ben Dunlap wrote: OK, I think I understand most points except the start and stop time. Every time sheet I have used, SAP and several other smaller ones, I enter a weeks worth of time data like: Project Sun Mon TuesWed ThurFri Sat --- Grill steaks 8 8 8 8 0 Vacation 0 0 0 0 8 So why wouldn't I store the dates and the hours instead of start and stop times? Maybe it comes down to what the users of the app prefer (or what you prefer, if you're building this app for yourself). From a user's perspective, I like start/stop data-entry better. I love that I can do this in Freshbooks, for example -- just click 'start' and then later click 'stop', 'log hours' -- and I never have to think about things like how many hours are there between 11:26am and 2:12pm? I think Ralph's point was that start/stop data is about as granular as any sort of time-keeping data gets, so if you store only start/stop data, you have ultimate flexibility in the way you can manipulate that data in your app. And it's probably a reasonable generalization that the most forward-looking database designs will store data in as simple and raw a form as possible. Or as Ralph put it, a good data design keeps only data in a table u can not calculate. With start/stop data, you could create weekly timesheets like the one above, in PHP -- and you could also figure out how many hours you log before noon, on average, etc. On the other hand, if the simplest data you enter is already the implicit result of a calculation (stop_time - start_time), you've limited the flexibility of your app from the get-go. But maybe that limitation isn't significant for the app you're building. Ben I see. I'm coming at this from an IT consultant perspective, where you're just like an employee, you work M-F 8 or so hours a day normally. So really your just filling it out for billing but it would normally be 8 hours M-F sometimes with vacation etc. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 6 and MySQL 5 for Dynamic Web Sites Book
Has anyone read this book by Larry Ullman yet? If so, what do you think about it? I'm looking for a well-rounded book that covers PHP for e-commerce websites and from what little I've been able to find online, it looks pretty good. Or would you recommend another book? I know that no book has all the answers - I just want something in my hands to read. However, I've bought a few Perl books that were a waste of money, so this time, I thought I'd ask first. Thanks, Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP 6 and MySQL 5 for Dynamic Web Sites Book
why do u stick to php 6? i would recommend www.scribd.com and have a search on PHP. there are books on beginners for php5 and articles of the difference to php 6. a very usefull site by the way, made me stopping buying books. loads of material on IT stuff. ralph ralph_def...@yahoo.de sono...@fannullone.us wrote in message news:43bda83e-2383-48a8-87ca-4408244fa...@fannullone.us... Has anyone read this book by Larry Ullman yet? If so, what do you think about it? I'm looking for a well-rounded book that covers PHP for e-commerce websites and from what little I've been able to find online, it looks pretty good. Or would you recommend another book? I know that no book has all the answers - I just want something in my hands to read. However, I've bought a few Perl books that were a waste of money, so this time, I thought I'd ask first. Thanks, Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying user data and picture
I am new to php... I try to make a php page that displays form submitted data and image. There are 3 php files, tampil_tamu_admin.php, edit_tamu.php and display_img.php. The user lists are displayed in the tampil_tamu_admin.php, and when the user clicks one record, it shows edit page (edit_tamu.php) that display user data and picture. (edit_tamu.php file includes img tag that calls display_img.php with user id) The problem is the user data is displayed but the image is not displayed... How can I display this image ? The codes are attached Thanks http://www.nabble.com/file/p24839092/guest-book.rar guest-book.rar http://www.nabble.com/file/p24839092/guest-book.zip guest-book.zip -- View this message in context: http://www.nabble.com/Displaying-user-data-and-picture-tp24839092p24839092.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] navigation include not functioning (RESOLVED)
On Wed, Aug 05, 2009 at 02:55:07PM -0700, Ben Dunlap wrote: In my navigation.php include file, I had if ($page = about) echo href I changed it to if ($page == about) echo and it suddenly worked! Imagine that... Another good case for putting the variable on the right side of ==: if (about == $page) Then if you mis-type == as =, PHP will fail immediately with a parse error. It feels a little weird but if it saves a lot of head-desk moments it's probably worth it. Now if only I could get into the habit myself... This is common practice for a lot of C programmers for exactly this reason. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need quick got written up yesterday!! OUCH (RESOLVED)
Miller, Terion wrote: Shawn you know repeatedly have been nothing but an asshole to me on this list, I have said before I'm not a php programmer, I was a front end designer, need graphics , need a css layout...see meneed backend programming..I'm trying... Stop being such a egomaniacal dickhead, a social life may do you good. If your job description does not include php development, and they are asking you to do it, then ask them to pay for the necessary books for you to learn PHP or do not accept the assignment, pointing out that you are not a PHP developer. If you job description includes php development, then you need to know what you are doing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php