Re: [PHP] Web Development/Application Analysis
On Sat, Mar 21, 2009 at 6:33 PM, tedd tedd.sperl...@gmail.com wrote: At 6:15 PM +0300 3/21/09, OOzy Pal wrote: Tedd, You wrote a long story about a client hiring a programmer which not what I am asking. Anyhow, thank you for your post. I learned from it. I don't want to take it further. This php mailing list. Really -- is that what this is? I thought it was a place where people could ask: -- quote I have just hired a remote PHP programmer. His main job is web development and applications. I have few concerns, I would be happy if someone can point me to the right direction. 1. How can I provide him the requirements. I mean how can I analyze the site and put everything in writing. 2. How can I estimate manhours. -- unquote For which I provided advice and example, which apparently fell on deaf ears. As such, I won't waste my time entertaining any other questions from you. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Again, I thank you for your post. It was beneficial. If I may ask you to use the time that you will not use for asnwering my questions in reading about relaxation politness. No matter what type disagreement happend between any two, that does not give any one of them the right to insult the other. -- OOzy Ubuntu (8.10) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DOMElement - attributes and namespace
Here's my function - private function filterAttributes($node) { // filters the attribute names and content $attributes = $node-attributes; foreach ($attributes as $attribute) { // allow colon as it is used in namespace attributes - // needs to be tested though, may require different handling?? // I should get a MathML document and try it out. $pattern = '/[^a-z0-9:-]+/i'; $clean = strtolower(preg_replace($pattern,'',$attribute-name)); if (strcmp($clean,$attribute-name) != 0) { $this-policyReport(Invalid Attribute Name); } $saniAtt[] = $clean; if (strcmp($clean,value) != 0) { if ($clean == src) { $saniVal[] = $this-obfus($attribute-value,1); } elseif ($clean == data) { $saniVal[] = $this-obfus($attribute-value,1); } elseif ($clean == code) { $saniVal[] = $this-obfus($attribute-value,1); } else { $saniVal[] = $this-obfus($attribute-value); } } else { // do not alter value attributes $saniVal[] = $attribute-value; } $oldAtt[] = $attribute-name; } if (isset($oldAtt)) { for ($i=0; $isizeof($oldAtt);$i++) { $node-removeAttribute($oldAtt[$i]); } } if (isset($saniAtt)) { for ($i=0; $isizeof($saniAtt);$i++) { $check = . $saniAtt[$i] . ; if (substr_count($this-blacklist, $check) == 0) { $node-setAttribute($saniAtt[$i],$saniVal[$i]); } else { $string = Blacklisted Event Attribute: . $saniAtt[$i]; $this-policyReport($string); } } } } (entire class here - http://www.clfsrpm.net/xss/cspfilter_class.phps) Here's the problem - $attributes = $node-attributes; creates a list that has both regular attributes and namespaced attributes. But I don't know how to programatically tell them apart. Here's the problem - when the attribute involves a namespace, IE xml:lang - $node-removeAttribute($oldAtt[$i]); doesn't remove it. $node-setAttribute($saniAtt[$i],$saniVal[$i]); creates a new attribute WITHOUT the namespace. So if we have xml:lang=something after the function is run, the result is that there is an additional attribute lang=filtered something but xml:lang remains with the unfiltered attribute content. If I knew a way to tell whether or not an attribute was namespaced I could deal with it by using the correct $node-removeAttributeNS and $node-setAttributeNS for those attributes, but I don't know how to tell them apart programatically. It seems that $attribute-name when the attribute is foo:bar will just return bar, and I can't tell if it was originally foo:bar, xml:bar, freak:bar, or just plain bar. The extremely sparse documentation in the php manual on this area isn't exactly helping me figure it out. Any help would be appreciated. To see the problem - http://www.clfsrpm.net/xss/dom_script_test.php Put p xml:bar = javascript:something elseA Paragraph/p into the textarea and hit submit - and you'll see what the function does with the attribute. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOMElement - attributes and namespace
Michael A. Peters wrote: Here's the problem - $attributes = $node-attributes; creates a list that has both regular attributes and namespaced attributes. But I don't know how to programatically tell them apart. http://phpbuilder.com/manual/en/class.domattr.php What would be really nice is if I could do $attribute-namespace the same way I could do $attribute-name and $attribute-value That would easily allow me to solve the problem. Is there a reason why that isn't part of the DOMAttr class? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Select Query with Multiple Optional Values
On Sun, 2009-03-22 at 09:22 +0800, Virgilio Quilario wrote: Trying to find best way to accomplish following scenario. Looking to search inventory through a POST form, have the following optional fields to search by: Product Name, Color, Size, and Status. Search maybe for the Product Name and/or Color or they may search for just the Color or all 4 fields. I am trying to find the most efficient way to do this without having 100 different if statements. ?php $where = array( '1 = 1' ); if( !empty( $_POST['name'] ) ) { where[] = 'name = '.$db-quote( $_POST['name'] ); } if( !empty( $_POST['colour'] ) ) { where[] = 'colour = '.$db-quote( $_POST['colour'] ); } if( !empty( $_POST['size'] ) ) { where[] = 'size = '.$db-quote( $_POST['size'] ); } if( !empty( $_POST['status'] ) ) { where[] = 'status = '.$db-quote( $_POST['status'] ); } $query = SELECT .* .FROM .inventory .WHERE .(.implode( ) AND (, $where ).); ? Cheers, Rob. Yep, that's the way to do it. Or you may do it this way. $fields = array('name','colour','size','status'); foreach ($_POST as $name = $value) { if (empty($value)) continue; if (!in_array($name, $fields, TRUE)) continue; $where[] = $name . '=' . $db-quote($value); } which is more compact and useful when you have 100 different optional fields. As long as your form field names are the same as your database field names. Also as long as you don't need to post process the submitted values in any way :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOMElement - attributes and namespace
Michael A. Peters wrote: Michael A. Peters wrote: Here's the problem - $attributes = $node-attributes; creates a list that has both regular attributes and namespaced attributes. But I don't know how to programatically tell them apart. http://phpbuilder.com/manual/en/class.domattr.php What would be really nice is if I could do $attribute-namespace the same way I could do $attribute-name and $attribute-value That would easily allow me to solve the problem. Is there a reason why that isn't part of the DOMAttr class? I found a dirty fix - it works but isn't proper. I think this is a bug in either $node-elements or DOMAttr Either the first needs to provide a way to tell what is before the : when a : exists in an attribute name or the second needs to either provide it in DOMAttr-name or provide another way to access what (if anything) is before a semicolon. At some point I'll get the guts to report it as a bug just to be told it isn't a bug with the standard response that says it isn't a bug and absolutely no explanation as to why. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Development/Application Analysis
2009/3/22 OOzy Pal oozy...@gmail.com: On Sat, Mar 21, 2009 at 6:33 PM, tedd tedd.sperl...@gmail.com wrote: At 6:15 PM +0300 3/21/09, OOzy Pal wrote: Tedd, You wrote a long story about a client hiring a programmer which not what I am asking. Anyhow, thank you for your post. I learned from it. I don't want to take it further. This php mailing list. Really -- is that what this is? I thought it was a place where people could ask: -- quote I have just hired a remote PHP programmer. His main job is web development and applications. I have few concerns, I would be happy if someone can point me to the right direction. 1. How can I provide him the requirements. I mean how can I analyze the site and put everything in writing. 2. How can I estimate manhours. -- unquote For which I provided advice and example, which apparently fell on deaf ears. As such, I won't waste my time entertaining any other questions from you. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Again, I thank you for your post. It was beneficial. If I may ask you to use the time that you will not use for asnwering my questions in reading about relaxation politness. No matter what type disagreement happend between any two, that does not give any one of them the right to insult the other. I disagree. I believe it's a basic human right to say whatever you want. It's also a basic human right to take offence at anything said to or about you, but that's your choice. Stopping people from speaking their minds is an early step on a steep downward hill. Oh, and I fart in your general direction, etc, etc ;-) Anyway, back to the point. You asked a question about dealing with a remote developer. Regardless of whether you employ that person full time, on a contract basis or ad hoc you are their client so Tedd's comments formed a valid response to the question. All too often people take the words of other people and apply their own definitions and decide it doesn't apply. In my view this list and the people on it are my clients, as is the board at my day job, as is my better half, etc. A client to me (and a fair percentage of the people I know) is anyone you do stuff regardless of remuneration, and very similar procedures apply to all different types of clients for the purposes of specifying requirements and estimating effort. Now that's done, it's Mothers Day here in jolly old England, and I have a phonecall to make! -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Web Development/Application Analysis
Date: Sun, 22 Mar 2009 11:51:45 + From: stut...@gmail.com To: oozy...@gmail.com CC: php-general@lists.php.net Subject: Re: [PHP] Web Development/Application Analysis 2009/3/22 OOzy Pal oozy...@gmail.com: On Sat, Mar 21, 2009 at 6:33 PM, tedd tedd.sperl...@gmail.com wrote: At 6:15 PM +0300 3/21/09, OOzy Pal wrote: Tedd, You wrote a long story about a client hiring a programmer which not what I am asking. Anyhow, thank you for your post. I learned from it. I don't want to take it further. This php mailing list. Really -- is that what this is? I thought it was a place where people could ask: -- quote I have just hired a remote PHP programmer. His main job is web development and applications. I have few concerns, I would be happy if someone can point me to the right direction. 1. How can I provide him the requirements. I mean how can I analyze the site and put everything in writing. 2. How can I estimate manhours. -- unquote For which I provided advice and example, which apparently fell on deaf ears. As such, I won't waste my time entertaining any other questions from you. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Again, I thank you for your post. It was beneficial. If I may ask you to use the time that you will not use for asnwering my questions in reading about relaxation politness. No matter what type disagreement happend between any two, that does not give any one of them the right to insult the other. I disagree. I believe it's a basic human right to say whatever you want. It's also a basic human right to take offence at anything said to or about you, but that's your choice. Stopping people from speaking their minds is an early step on a steep downward hill. Oh, and I fart in your general direction, etc, etc ;-) Anyway, back to the point. You asked a question about dealing with a remote developer. Regardless of whether you employ that person full time, on a contract basis or ad hoc you are their client so Tedd's comments formed a valid response to the question. All too often people take the words of other people and apply their own definitions and decide it doesn't apply. In my view this list and the people on it are my clients, as is the board at my day job, as is my better half, etc. A client to me (and a fair percentage of the people I know) is anyone you do stuff regardless of remuneration, and very similar procedures apply to all different types of clients for the purposes of specifying requirements and estimating effort. Now that's done, it's Mothers Day here in jolly old England, and I have a phonecall to make! -Stuart Oh Stuart!!! Hit me. You won't believe that I've been coding all the while and I forgot it's mother's day. Well, while you're at it, you can help me call my mum in jolly good NIGERIA and tell her Happy mother's day for me. Alugo Abdulazeez www.frangeovic.com _ Drag n’ drop—Get easy photo sharing with Windows Live™ Photos. http://www.microsoft.com/windows/windowslive/products/photos.aspx
Re: [PHP] how to make multiple sql run faster
On 03/21/2009 10:19 AM, Andrea Giammarchi wrote: Hi all, I am inserting more than 5000 rows into sql database but its taking more than 30 mins to get it all the data inserted. I use union to insert multiple rows of 20 at a time. What is the best way to make insert sql statement run faster Usually a single transaction is faster than an insert a time (with or without union) What do you mean? START TRANSACTION; INSERT; INSERT; INSERT; COMMIT; Is that? Thank you very much davi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Development/Application Analysis
At 9:57 AM +0300 3/22/09, OOzy Pal wrote: On Sat, Mar 21, 2009 at 6:33 PM, tedd tedd.sperl...@gmail.com wrote: As such, I won't waste my time entertaining any other questions from you. If I may ask you to use the time that you will not use for asnwering my questions in reading about relaxation politness. No matter what type disagreement happend between any two, that does not give any one of them the right to insult the other. OOzy: Two points. First point: You asked two questions that implied you were a client seeking advice on how to deal with a programmer. I answered your questions from that perspective (and did a good job of it). Then you come back with additional information, which you should have provided in your original question. And finally said you really didn't need the information I provided, which leads me to believe that you didn't read it either. All of which illustrates the main point of my answer, which was basically to *fully* communicate what you want to the programmer. In other words, don't do what you just did! Second point: Where in all of this exchange did I insult you? All I did was to identify that you don't know how to ask questions so next time I'll pass on answering yours. That's not an insult, that's a choice. You say that I should spent time reading about relaxation politness (sic) -- what the hell is that? (Rhetorical question) That sounds like the typical fluff from the political correctness crowd. Usually when they're intellectually cornered they resort to Let's don't discuss your point because you hurt my feelings nonsense. In any event, if you're going to continue in this field, I suggest that you improve your communication skills and develop a thicker skin. Good luck with your remote programmer. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOMElement - attributes and namespace
Michael A. Peters wrote: At some point I'll get the guts to report it as a bug just to be told it isn't a bug with the standard response that says it isn't a bug and absolutely no explanation as to why. Bug ID 47747 Clear demonstration test case - http://www.clfsrpm.net/bugs/domattr.phps http://www.clfsrpm.net/bugs/domattr.php I'll wait to see what they say, but if anyone knows how to get the xml:lang from the attribute list w/o knowing it is xml: - I would really like to know. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Development/Application Analysis
On Sun, Mar 22, 2009 at 09:02, tedd tedd.sperl...@gmail.com wrote: Good luck with your remote programmer. I second that, OOzy. You're going to need all the luck you can get with the web development/design business you apparently own. Since you obviously have no clue what it's like to freelance and instead prefer to attempt to dominate a conversation by asserting your opinion and ill-perceived fortitude, your business web site will probably only make the top 50 pages on Google by searching for the name explicitly. And even then, I wouldn't be surprised to hear that it's the third or fourth result. Learn about the business and don't spit in the face of those who attempt to give you free advice. Don't just wake up one morning, register a domain name, and say you own a company. I've seen you on the Apache and Linux kernel lists over the years. You know your stuff, and you've been on mailing lists long enough to know that the kind of attitude you had toward Tedd earlier won't glean the best results from the other list subscribers. So why start in that direction now? Read Tedd's stuff and learn what you can from it. Don't open yourself up to getting flamed and ignored for the rest of your time here. -- /Daniel P. Brown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Development/Application Analysis
2009/3/22 OOzy Pal oozy...@gmail.com On Sat, Mar 21, 2009 at 6:33 PM, tedd tedd.sperl...@gmail.com wrote: At 6:15 PM +0300 3/21/09, OOzy Pal wrote: Tedd, You wrote a long story about a client hiring a programmer which not what I am asking. Anyhow, thank you for your post. I learned from it. I don't want to take it further. This php mailing list. Really -- is that what this is? I thought it was a place where people could ask: -- quote I have just hired a remote PHP programmer. His main job is web development and applications. I have few concerns, I would be happy if someone can point me to the right direction. 1. How can I provide him the requirements. I mean how can I analyze the site and put everything in writing. 2. How can I estimate manhours. -- unquote For which I provided advice and example, which apparently fell on deaf ears. As such, I won't waste my time entertaining any other questions from you. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Again, I thank you for your post. It was beneficial. If I may ask you to use the time that you will not use for asnwering my questions in reading about relaxation politness. No matter what type disagreement happend between any two, that does not give any one of them the right to insult the other. -- OOzy Ubuntu (8.10) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Oozy, Lighten up, brother. I read your original question and I thought This guy shoulda started asking these questions before her started hiring people. Tedd invested time, thought and energy in to giving you a quality response. I don't have the kind of field experience to give you an answer of that caliber. I personally felt that I benefited from reading Tedd's response to you, so it shouldn't have been too difficult for you to gain from it. After that, you announced yourself the owner. It may have escaped your scrutiny, but the kind people that hang out here trying to assist people with their PHP challenges are *NOT* here to do your job for you. That, in my opinion, is what you asked. I've started a business and hired a programmer. Now somebody please explain to me how to be his boss, otherwise it is going to be a difficult week. Then you deal a really uninventive insult (my questions in reading about relaxation politness.) to a guy who has shown vast amounts of patience and politeness to both, you, and the other's that he has helped -- if you've been watching. Then you wrap it up with the decree No matter what type disagreement happend between any two, that does not give any one of them the right to insult the other. which is particularly rubbish following the sentence where you insulted Tedd. Also, you will find that people do, in fact, have the right to insult each other with, or without, disagreement. This is something that you'll observe quite readily by hanging out on the PHP list. So far, imo, everybody has been pretty nice to you. So why don't you go spend some times with those books about 'relaxation politness' and stop pitching what you ain't prepared to catch?
[PHP] Frameworks Which Have A Bake Function?
Hi Guys, I have been using cakephp for a while as a development framework. I'm also thinking for a while to use another framework and leave cakephp alone (too much babbling.. it takes too much time until you get to the code itself..), now I have decided to move on and here comes my question. Do you have any suggestions on frameworks which have something similar to the cakephp's bake function? (you create your database tables structure, run bake.php from ssh and kaboom! you have model/view/controller for each of the tables: insert, delete, modify, list data). I know it is possibile in ROR but never heard of any other framework or development library or anything like that in php except cakephp that gives you this functionallity. Thanks in Advance, Nitsan
[PHP] MYSQL TABLES (One To Many Relationship)
Hi guys, I need help on something I'm working on and its really eating me up so I'll appreciate any help I can get on it. I'm writing code for a site that posts a topic for discussion and accepts comments (Just like a parliament). There are different discussions for every day and the comments should be displayed along with the corresponding topics per day. Now I wrote the code below but dont know if I'm right. (I created two tables in my database and to create a relationship between the tables, I put the id field for the topics into the comments table): ?php function getpost_comments() { global $conn; //This gets the database started (already defined) $result= mysql_query(SELECT * FROM Pcomments, Parliaments WHERE Pcomments.pcomment_id=Parliaments.parliament_id); if (!$result) print mysql_error(); else { while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ print $row[name] - $row[comment]br/\n; } } } ? I know some of you will probably think its a stupid question but I'm going with the school of thought that says the only stupid question is the one that's not asked. Thanks in anticipation of your positive responses. Alugo Abdulazeez www.frangeovic.com. _ Show them the way! Add maps and directions to your party invites. http://www.microsoft.com/windows/windowslive/products/events.aspx
Re: [PHP] Frameworks Which Have A Bake Function?
Don't forget to attach the message to the list. Regarding the frameworks, which of them, for your opinion, will take the fastest time to learn and get into code? Thanks On Sun, Mar 22, 2009 at 5:59 PM, Graham Christensen graham.christen...@iamgraham.net wrote: Look into Doctorine || Propel, they both will take a db structure - models. Symfony might be worth looking at, you can tell it to create a basic view/controller for them as well. Graham On Mar 22, 2009, at 11:52 AM, Nitsan Bin-Nun wrote: Hi Guys, I have been using cakephp for a while as a development framework. I'm also thinking for a while to use another framework and leave cakephp alone (too much babbling.. it takes too much time until you get to the code itself..), now I have decided to move on and here comes my question. Do you have any suggestions on frameworks which have something similar to the cakephp's bake function? (you create your database tables structure, run bake.php from ssh and kaboom! you have model/view/controller for each of the tables: insert, delete, modify, list data). I know it is possibile in ROR but never heard of any other framework or development library or anything like that in php except cakephp that gives you this functionallity. Thanks in Advance, Nitsan
[PHP] quick question - need a site i can more or less copy from
Hi... Working on a test app, and I need a web interface to test/view the underlying information. Looking for (hopefully) quick pointers/suggestions. I'm dealing with a number of cli web crawling apps that return data. I'm trying to find a quick app that I can modify the db schema, as well as some of the underlying logic to display my data. my returned data consists of: university school dept class classname classID classdescription classA classB faculty The above is a represenation of the levels of data. I'm looking to have multiple tbls, each of which links to the child tbl... I'm not a web dev, and i'm looking for some sort of web app that i might rip apart/modify so i can start to be able to view this data on a web app.. i'm currently looking through sourceforge/freshmeat/etc... thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] webmin mods..
oh... has anyone ever played/used/modified the webmin app?? i'm looking for a web based app/tool that i can modify to be able to manage my distribbuted client/server crawler on my network of boxes. i'd rather start with an existing framework/app that already kind of works with modules/apps on a system, and then modify it to meet my needs... i'm ultimately looking for a php based web app that i can modify to allow me to schedule running my crawler... along with a huge number of additional functions.. thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Frameworks Which Have A Bake Function?
Qcodo and symfony both have an ORM layer that can do that. They will provide/return and basic set of classes that interact with those tables. Bastien Sent from my iPod On Mar 22, 2009, at 11:52, Nitsan Bin-Nun nit...@binnun.co.il wrote: Hi Guys, I have been using cakephp for a while as a development framework. I'm also thinking for a while to use another framework and leave cakephp alone (too much babbling.. it takes too much time until you get to the code itself..), now I have decided to move on and here comes my question. Do you have any suggestions on frameworks which have something similar to the cakephp's bake function? (you create your database tables structure, run bake.php from ssh and kaboom! you have model/view/controller for each of the tables: insert, delete, modify, list data). I know it is possibile in ROR but never heard of any other framework or development library or anything like that in php except cakephp that gives you this functionallity. Thanks in Advance, Nitsan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Web Development/Application Analysis
From: Stuart Now that's done, it's Mothers Day here in jolly old England, and I have a phonecall to make! Hi Stuart, Thank her for us while you're on that call. You turned out pretty well, so I think she done good. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MYSQL TABLES (One To Many Relationship)
At 5:04 PM +0100 3/22/09, abdulazeez alugo wrote: Hi guys, I need help on something I'm working on and its really eating me up so I'll appreciate any help I can get on it. I'm writing code for a site that posts a topic for discussion and accepts comments (Just like a parliament). There are different discussions for every day and the comments should be displayed along with the corresponding topics per day. Hi Alugo: I wrote a similar thing for my site, see here: http://sperling.com As you can see, on most pages people can add comment. Considering such, the most important part I found was designing the tables for the database. I used two tables, which follow showing fields: COMMENTS table Fields id -- auto-increment id for comments post_time -- time of this post poster_id -- the id from the POSTERS table page -- the page the poster commented on comment -- the actual comment made by the poster notify_me -- an option for the poster to select IF they want to be notified of additional posts approved -- option for me to use if I want the post to be displayed POSTERS table Fields id -- auto-increment id for posters time -- time of first post (i.e., registration) poster -- name of poster email -- email of poster (after confirmation of email address) ip -- ip of poster (taken from post) web_site -- web site of poster (if given) banned -- option for me to use if I want to ban this poster So as you can see, this is one table for posters and each poster can post many comments (i.e., a one to many relationship). Each time a post is made, the posting method checks the database for poster approval. Either the poster is approved, banned, or yet to be registered -- each path is followed accordingly. Note as each page is loaded the comments are pulled from the database and shown, or not, depending upon if the poster is approved OR if I have overridden the post. This allows me to ban the post, but not the poster. But in most cases, if the poster post something that I don't like, then the poster is also banned. HTH's tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Frameworks Which Have A Bake Function?
Nitsan Bin-Nun nit...@binnun.co.il wrote in message news:d47da0100903220852v565771e5r9a3a72184a0a...@mail.gmail.com... Hi Guys, I have been using cakephp for a while as a development framework. I'm also thinking for a while to use another framework and leave cakephp alone (too much babbling.. it takes too much time until you get to the code itself..), now I have decided to move on and here comes my question. Do you have any suggestions on frameworks which have something similar to the cakephp's bake function? (you create your database tables structure, run bake.php from ssh and kaboom! you have model/view/controller for each of the tables: insert, delete, modify, list data). I know it is possibile in ROR but never heard of any other framework or development library or anything like that in php except cakephp that gives you this functionallity. Thanks in Advance, Nitsan All this is possible with the Radicore framework, but it is more sophisticated. It requires the following steps: (1) Import your database table structures into the Data Dictionary (see http://www.tonymarston.net/php-mysql/data-dictionary.html and http://www.tonymarston.net/php-mysql/menuguide/appendixn.html) (2) Export each database table to produce the class file for that table. (3) Generate a task by choosing a database table and a Transaction Pattern (see http://www.tonymarston.net/php-mysql/dialog-types.html). The list of transaction patterns which are available is more extensive than the basic list, search, create, read, update and delete. -- Tony Marston http://www.tonymarston.net http://www.radicore.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Frameworks Which Have A Bake Function?
Nitsan Bin-Nun nit...@binnun.co.il wrote in message news:d47da0100903220910q7bb66706s6255f0fc89b98...@mail.gmail.com... Don't forget to attach the message to the list. Regarding the frameworks, which of them, for your opinion, will take the fastest time to learn and get into code? Generally speaking if something is fast to learn it is also the first to run out of steam. If it doesn't have more features than you can learn in five minutes the it doesn't have enough features to do anything useful, or with any degree of flexibility. -- Tony Marston http://www.tonymarston.net http://www.radicore.org Thanks On Sun, Mar 22, 2009 at 5:59 PM, Graham Christensen graham.christen...@iamgraham.net wrote: Look into Doctorine || Propel, they both will take a db structure - models. Symfony might be worth looking at, you can tell it to create a basic view/controller for them as well. Graham On Mar 22, 2009, at 11:52 AM, Nitsan Bin-Nun wrote: Hi Guys, I have been using cakephp for a while as a development framework. I'm also thinking for a while to use another framework and leave cakephp alone (too much babbling.. it takes too much time until you get to the code itself..), now I have decided to move on and here comes my question. Do you have any suggestions on frameworks which have something similar to the cakephp's bake function? (you create your database tables structure, run bake.php from ssh and kaboom! you have model/view/controller for each of the tables: insert, delete, modify, list data). I know it is possibile in ROR but never heard of any other framework or development library or anything like that in php except cakephp that gives you this functionallity. Thanks in Advance, Nitsan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] webmin mods..
bruce wrote: oh... has anyone ever played/used/modified the webmin app?? i'm looking for a web based app/tool that i can modify to be able to manage my distribbuted client/server crawler on my network of boxes. i'd rather start with an existing framework/app that already kind of works with modules/apps on a system, and then modify it to meet my needs... i'm ultimately looking for a php based web app that i can modify to allow me to schedule running my crawler... along with a huge number of additional functions.. thanks Way back when OS X 10.0 shipped I ported webmin to properly work with OS X (and even got the patch accepted into webmin upstream) - it isn't difficult to work with, but remember, it's perl, not php. People Hate Perl :p It isn't difficult to write webmin modules. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Having trouble with a form to mail script.
From: dane...@bluerodeo.com To: nads...@live.com Subject: Re: [PHP] Having trouble with a form to mail script. Date: Sat, 21 Mar 2009 09:43:25 -0700 On Mar 21, 2009, at 3:47 AM, Linda Stark wrote: $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; mail( h...@mydomain.com, Feedback Form Results, $message, From: $email ); header( Location: http://www.mydomain.com/thankyou.html; ); ? The email is received, but with a blank return email address and an empty message. None of the comments or form values get through - just a blank email sent to my address. Can anyone point me in the right direction – what am I doing wrong? The PHP code above is only looking for values named email and message. Your new form has values with many more different names. So you'll need to update your code in incorporate them. For example, one of your new forms values is emailAddress, so your php code will need something like: $email_address = $REQUEST['emailAddress']; A second problem is that the code above is only sending back the contents of message. But you will need to send back more. So you may want to create a variable called $contents, which includes all the new fields on your longer form. Something like: $content = Message: $message ; $content .= Email: $emailAddress ; Then update: mail( h...@mydomain.com, Feedback Form Results, $message, From: $email ); with: mail( h...@mydomain.com, Feedback Form Results, $content, From: $email ); But keep in mind, this is a very simple form, and does not account for many security measures and corrections. This will only mail you whatever the person initially inputs. It does not check for things like whether an email address was entered and it is wide open for spam. If you are doing the form yourself in order to study PHP, you may want to do some google searches on creating a secure web form. If you are building the form in order to get a quick working form, you may want to look into using a pre-made script with more advanced functionality. Thanks so much for all your helpful advice yesterday and today, I read every response and I'm working on the script with your suggestions. Actually I bought a couple of php books too. Actually DG, I'm glad you brought up the security issue, because yesterday I researched some pre made mail form scripts, I was wondering what you guys thought about the PHPMailer-FE from http://phpmailer.codeworxtech.com/index.php?pg=phpmailerfe I'm think for now I should use a pre made and secure script while I learn php and then maybe some time in the future I'll write my own when I feel Confident. The site claims it is a secure and regularly updated script, do you guys agree? Apparently in 2007 there was a security vulnerability in the script and they went a long time without patching it… Another point - I bought the book – “The Essential Guide to Dreamweaver CS4 with CSS, Ajax, and PHP” by Powers and in it the author claims that if you want to accept html mail, use this script, but he does not recommend it because when browsers are configured to not accept html mail there should also be a text alternative anyway. He goes through a good tutorial on how to create a form mail script for text only and includes the code snippets and claims it is a secure script. What do you think would be better? Use his code from his book? Or use PHPMailer-FE? Or would you recommend a different script than that that accepts only non html mail? I was also looking at the forms-to-go code generator which is a drag and drop application which you can drop your form into and it creates your php – does that application write secure code, or am I better off staying away from it and going with a well written secure script? I don't really care about file and photo uploads right now, as long as I can get a basic email via the web form that’s all I need for now... _ Express your personality in color! Preview and select themes for Hotmail®. http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_WL_HM_express_032009#colortheme -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [SOLVED] How do you use php-gettext?
Now it works... I do not know why but it works. Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # http://www.tamay-dogan.net/ Michelle Konzack http://www.can4linux.org/ Apt. 917 http://www.flexray4linux.org/ 50, rue de Soultz Jabber linux4miche...@jabber.ccc.de 67100 Strasbourg/France IRC #Debian (irc.icq.com) Tel. DE: +49 177 9351947 ICQ #328449886Tel. FR: +33 6 61925193 signature.pgp Description: Digital signature
[PHP] Frameworks / obstinate?
Tony Marston wrote: Nitsan Bin-Nun nit...@binnun.co.il wrote in message news:d47da0100903220910q7bb66706s6255f0fc89b98...@mail.gmail.com... Don't forget to attach the message to the list. Regarding the frameworks, which of them, for your opinion, will take the fastest time to learn and get into code? Generally speaking if something is fast to learn it is also the first to run out of steam. If it doesn't have more features than you can learn in five minutes the it doesn't have enough features to do anything useful, or with any degree of flexibility. Hello, I changed the subject because I did not want to steal Nitsan's thread. There seem to be a ton of frameworks, one-click installation web applications, the latest and greatest wiz-bang applications out there. I find myself extremely reluctant to dig into these code sets. It seems when I do attempt to use one of these pre-coded applications I end up eventually wanting to modify the code outside of the original extent of the project. Invariably I get frustrated and end up wishing I initially begun the development from scratch. Employers seem to be wanting me to have experience with all kinds of 'gimicky' solutions, but I am reluctant to be constantly learning new applications (that i'd prefer to rewrite myself). Am I just being hard headed and reluctant to change, or is my stance justified? I suppose the answer is the middle-path. That is, read some new projects, take the bits I like, leave the bits I don't, etc...The problem is this isn't very marketable. But I suppose, the proof is in the pudding. What a banal way to end an email, eh? What are your thoughts in regard to these two forces: wiz-bang frameworks vs. raw php development? thanks,
Re: [PHP] Frameworks / obstinate?
On Sun, 2009-03-22 at 10:54 -1000, Daniel Kolbo wrote: Hello, I changed the subject because I did not want to steal Nitsan's thread. I hope you started a New email and didn't just change the subject... otherwise you've hijacked the thread. I can't tell I keep threading off. There seem to be a ton of frameworks, one-click installation web applications, the latest and greatest wiz-bang applications out there. I find myself extremely reluctant to dig into these code sets. It seems when I do attempt to use one of these pre-coded applications I end up eventually wanting to modify the code outside of the original extent of the project. Invariably I get frustrated and end up wishing I initially begun the development from scratch. Employers seem to be wanting me to have experience with all kinds of 'gimicky' solutions, but I am reluctant to be constantly learning new applications (that i'd prefer to rewrite myself). Am I just being hard headed and reluctant to change, or is my stance justified? I suppose the answer is the middle-path. That is, read some new projects, take the bits I like, leave the bits I don't, etc...The problem is this isn't very marketable. But I suppose, the proof is in the pudding. What a banal way to end an email, eh? What are your thoughts in regard to these two forces: wiz-bang frameworks vs. raw php development? thanks, I have my own framework that I wrote from scratch. I still learn other frameworks to some degree. Clients don't want you writing something from scratch when you can use something off the shelf. Preferrably you can hit the ground almost running with anything put before you, and hopefully they can give you that benefit of the doubt. Do I suggest you learn all frameworks? No! But do round yourself out and show that you are flexible. Nobody wants an immovable object in front of them. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to make multiple sql run faster
Davi Vidal wrote: On 03/21/2009 10:19 AM, Andrea Giammarchi wrote: Hi all, I am inserting more than 5000 rows into sql database but its taking more than 30 mins to get it all the data inserted. I use union to insert multiple rows of 20 at a time. What is the best way to make insert sql statement run faster Usually a single transaction is faster than an insert a time (with or without union) What do you mean? START TRANSACTION; INSERT; INSERT; INSERT; COMMIT; That's the right syntax. Are you using mysql? Are you using innodb tables? If you're using mysql but not innodb, then no point doing this since myisam is non-transactional. What's the actual query you're running? You shouldn't need to use a union for a straight insert. An insert-into-select query could use a union, but then how fast is the select statement by itself (without the insert) ? -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOMElement - attributes and namespace
Michael A. Peters wrote: Michael A. Peters wrote: At some point I'll get the guts to report it as a bug just to be told it isn't a bug with the standard response that says it isn't a bug and absolutely no explanation as to why. Bug ID 47747 Clear demonstration test case - http://www.clfsrpm.net/bugs/domattr.phps http://www.clfsrpm.net/bugs/domattr.php I'll wait to see what they say, but if anyone knows how to get the xml:lang from the attribute list w/o knowing it is xml: - I would really like to know. It was my misunderstanding. Properly fixing my code to deal with it is a PITA but is doable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Frameworks / obstinate?
Daniel Kolbo wrote: Tony Marston wrote: Nitsan Bin-Nun nit...@binnun.co.il wrote in message news:d47da0100903220910q7bb66706s6255f0fc89b98...@mail.gmail.com... Don't forget to attach the message to the list. Regarding the frameworks, which of them, for your opinion, will take the fastest time to learn and get into code? Generally speaking if something is fast to learn it is also the first to run out of steam. If it doesn't have more features than you can learn in five minutes the it doesn't have enough features to do anything useful, or with any degree of flexibility. Hello, I changed the subject because I did not want to steal Nitsan's thread. There seem to be a ton of frameworks, one-click installation web applications, the latest and greatest wiz-bang applications out there. I find myself extremely reluctant to dig into these code sets. It seems when I do attempt to use one of these pre-coded applications I end up eventually wanting to modify the code outside of the original extent of the project. Invariably I get frustrated and end up wishing I initially begun the development from scratch. Employers seem to be wanting me to have experience with all kinds of 'gimicky' solutions, but I am reluctant to be constantly learning new applications (that i'd prefer to rewrite myself). Am I just being hard headed and reluctant to change, or is my stance justified? I suppose the answer is the middle-path. That is, read some new projects, take the bits I like, leave the bits I don't, etc...The problem is this isn't very marketable. But I suppose, the proof is in the pudding. What a banal way to end an email, eh? What are your thoughts in regard to these two forces: wiz-bang frameworks vs. raw php development? thanks, Well, to your point and the OPs point, I use CakePHP, which for some reason the OP wants to get away from. In my opinion cake doesn't try to do all things or be all things to all people. Just like any framework or class/function library, if you're going to use it you have to learn it. For me, Cake is RAD I'm not a DB guy by trade, but have gotten myself into thinking of the DB after the site/app functionality. Then I whip up a DB schema, bake and I have a strawman working app. Then I start coding the real functionality. I tested qcodo briefly and it seemed very cool, cake but lighter and primarily using AJAX. I still like it, but it was way too light for me at the time, i.e. no classes to do the mundane stuff, which some call bloat. I'm not really a Zend fan (because I'm a hobby programmer and not die-hard OOP/pattern guy), but have been seeing the different code generation/app layout/ORM maybe generation plans in the Zend_Tool piece. FWIW, the only mature frameworks that I've seen are CakePHP, Symphony, and maybe 1 or 2 that I can't remember. Symphony for me at least is way too config heavy, Zend is PEAR, just a class libray but with stricter standards, and some of the others have promise but lack functionality or don't have a strong developer/community base. Just my 2 cents... Flame me away...! -- 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] Having trouble with a form to mail script.
On Mar 22, 2009, at 12:46 PM, Linda Stark wrote: what you guys thought about the PHPMailer-FE from http://phpmailer.codeworxtech.com/index.php?pg=phpmailerfe I'm not familiar with this. You might want to check with your web provider. I'm with Pair and they make security recommendations for code and pre-made scripts. if you want to accept html mail, use this script, but he does not recommend it because when browsers are configured to not accept html mail there should also be a text alternative anyway. That would depend on what the form is for. If the results are only going to a few people, and they accept HTML, it shouldn't be a problem. It is safer that way too, so your form can't be used to send off email to everywhere. There's an awful lot of variables to consider. This is a good start: http://shiflett.org/blog/2005/dec/essential-php-security-forms-and-urls -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Frameworks / obstinate?
My personal take on this goes something like this: I'm not a huge fan of re-inventing the wheel. However, it seems that since the first stable release of PHP 5 into the wild a much needed emphasis has been placed on OOP solutions within the PHP world. Don't read me wrong, I know the importance wasn't lost on folks who already had a good programming head on their shoulders, yet, in all fairness our hands were a bit tied (and I feel that I may receive some argument here) until PHP 5 reached its first stable release. That being said, I find that quite a few of the frameworks still seem to be fledglings and a lot of the new OS projects being built on them are like wheels with some lumps. Even a few commercial projects seem to be like this. I also have a positive outlook with PHP5 and 6 and that is that this language is finally reaching maturity. It is something that I believe and hope allow for continued growth of our new projects without feeling the need to dump them like I saw with the PHP4 projects. On a final rambling note, I like some of the new frameworks I've looked into recently, like CodeIgniter, Yii even Sapphire holds some promise (have a look at the cleaner version in progress). I find myself wanting to add to them, wanting to help improve them and occasionally I too have a fleeting moment where I think How would my framework be different if I built one from scratch? Then I realize I don't have that kind of time! lol My clients are waiting. Also, I don't seem to have much trouble switching between frameworks or languages for that matter (PERL, PHP, ASP(bleh), JavaScript, ActionScript) and I guess because of that I find myself just trying to find the best solution for the clients need at hand and build from there. -Original Message- From: Daniel Kolbo [mailto:kolb0...@umn.edu] Sent: Sunday, March 22, 2009 4:54 PM To: php-general@lists.php.net Cc: Tony Marston Subject: [PHP] Frameworks / obstinate? Tony Marston wrote: Nitsan Bin-Nun nit...@binnun.co.il wrote in message news:d47da0100903220910q7bb66706s6255f0fc89b98...@mail.gmail.com... Don't forget to attach the message to the list. Regarding the frameworks, which of them, for your opinion, will take the fastest time to learn and get into code? Generally speaking if something is fast to learn it is also the first to run out of steam. If it doesn't have more features than you can learn in five minutes the it doesn't have enough features to do anything useful, or with any degree of flexibility. Hello, I changed the subject because I did not want to steal Nitsan's thread. There seem to be a ton of frameworks, one-click installation web applications, the latest and greatest wiz-bang applications out there. I find myself extremely reluctant to dig into these code sets. It seems when I do attempt to use one of these pre-coded applications I end up eventually wanting to modify the code outside of the original extent of the project. Invariably I get frustrated and end up wishing I initially begun the development from scratch. Employers seem to be wanting me to have experience with all kinds of 'gimicky' solutions, but I am reluctant to be constantly learning new applications (that i'd prefer to rewrite myself). Am I just being hard headed and reluctant to change, or is my stance justified? I suppose the answer is the middle-path. That is, read some new projects, take the bits I like, leave the bits I don't, etc...The problem is this isn't very marketable. But I suppose, the proof is in the pudding. What a banal way to end an email, eh? What are your thoughts in regard to these two forces: wiz-bang frameworks vs. raw php development? thanks, __ Information from ESET Smart Security, version of virus signature database 3953 (20090321) __ The message was checked by ESET Smart Security. http://www.eset.com __ Information from ESET Smart Security, version of virus signature database 3953 (20090321) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [SOLVED] How do you use php-gettext?
There are two example coming with php-gettext package. However, it is realy easy since you have to use only: print T_gettext(Hello World); or print sprintf(T_ngettext(%i Developer, %i Developers, ${COUNT}), $COUNT); Run the command xgettext -k T_gettext -k T_ -L PHP -o script.pot script.php and then you have the Translation Template. Copy it to your desired language like cp script.pot script.po and translate the msgstr. Not call the command msgfmt -o script.mo script.po and copy the file script.mo to your desired locale directory with e.g. cp script.mo /var/www/locale/de/LC_messages/ and then setup your script.php to use [ 'script.php' ] ?php define(PROJECT_DIR, realpath('/var/www')); define(LOCALE_DIR, PROJECT_DIR .'/locale'); define(DEFAULT_LOCALE, 'en_US'); require_once('/usr/share/php/php-gettext/gettext.inc'); $supported_locales = array('de_DE', 'de', 'en_US', 'en'); $encoding = 'UTF-8'; $locale = (isset($_GET['lang']))? $_GET['lang'] : DEFAULT_LOCALE; T_setlocale(LC_MESSAGES, $locale); $domain = 'script'; bindtextdomain($domain, LOCALE_DIR); bind_textdomain_codeset($domain, $encoding); textdomain($domain); print T_gettext(The rest of your script); ? 8-- Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # http://www.tamay-dogan.net/ Michelle Konzack http://www.can4linux.org/ Apt. 917 http://www.flexray4linux.org/ 50, rue de Soultz Jabber linux4miche...@jabber.ccc.de 67100 Strasbourg/France IRC #Debian (irc.icq.com) Tel. DE: +49 177 9351947 ICQ #328449886Tel. FR: +33 6 61925193 signature.pgp Description: Digital signature
Re: [PHP] Frameworks / obstinate?
Marc Christopher Hall wrote: My personal take on this goes something like this: I'm not a huge fan of re-inventing the wheel. However, it seems that since the first stable release of PHP 5 into the wild a much needed emphasis has been placed on OOP solutions within the PHP world. Don't read me wrong, I know the importance wasn't lost on folks who already had a good programming head on their shoulders, yet, in all fairness our hands were a bit tied (and I feel that I may receive some argument here) until PHP 5 reached its first stable release. That being said, I find that quite a few of the frameworks still seem to be fledglings and a lot of the new OS projects being built on them are like wheels with some lumps. Even a few commercial projects seem to be like this. I also have a positive outlook with PHP5 and 6 and that is that this language is finally reaching maturity. It is something that I believe and hope allow for continued growth of our new projects without feeling the need to dump them like I saw with the PHP4 projects. On a final rambling note, I like some of the new frameworks I've looked into recently, like CodeIgniter, Yii even Sapphire holds some promise (have a look at the cleaner version in progress). I find myself wanting to add to them, wanting to help improve them and occasionally I too have a fleeting moment where I think How would my framework be different if I built one from scratch? Then I realize I don't have that kind of time! lol My clients are waiting. Also, I don't seem to have much trouble switching between frameworks or languages for that matter (PERL, PHP, ASP(bleh), JavaScript, ActionScript) and I guess because of that I find myself just trying to find the best solution for the clients need at hand and build from there. -Original Message- From: Daniel Kolbo [mailto:kolb0...@umn.edu] Sent: Sunday, March 22, 2009 4:54 PM To: php-general@lists.php.net Cc: Tony Marston Subject: [PHP] Frameworks / obstinate? Tony Marston wrote: Nitsan Bin-Nun nit...@binnun.co.il wrote in message news:d47da0100903220910q7bb66706s6255f0fc89b98...@mail.gmail.com... Don't forget to attach the message to the list. Regarding the frameworks, which of them, for your opinion, will take the fastest time to learn and get into code? Generally speaking if something is fast to learn it is also the first to run out of steam. If it doesn't have more features than you can learn in five minutes the it doesn't have enough features to do anything useful, or with any degree of flexibility. Hello, I changed the subject because I did not want to steal Nitsan's thread. There seem to be a ton of frameworks, one-click installation web applications, the latest and greatest wiz-bang applications out there. I find myself extremely reluctant to dig into these code sets. It seems when I do attempt to use one of these pre-coded applications I end up eventually wanting to modify the code outside of the original extent of the project. Invariably I get frustrated and end up wishing I initially begun the development from scratch. Employers seem to be wanting me to have experience with all kinds of 'gimicky' solutions, but I am reluctant to be constantly learning new applications (that i'd prefer to rewrite myself). Am I just being hard headed and reluctant to change, or is my stance justified? I suppose the answer is the middle-path. That is, read some new projects, take the bits I like, leave the bits I don't, etc...The problem is this isn't very marketable. But I suppose, the proof is in the pudding. What a banal way to end an email, eh? What are your thoughts in regard to these two forces: wiz-bang frameworks vs. raw php development? thanks, __ Information from ESET Smart Security, version of virus signature database 3953 (20090321) __ The message was checked by ESET Smart Security. http://www.eset.com __ Information from ESET Smart Security, version of virus signature database 3953 (20090321) __ The message was checked by ESET Smart Security. http://www.eset.com Marc, Thanks for the thoughts. [quote]I find myself just trying to find the best solution for the clients need at hand and build from there.[/quote] Certainly the above is the mainstream/business approach. After all, they (businesses) need solutions today and not tomorrow. However, this is the culture that only serves to exemplify my point. All of these one-click-solutions are for today, who is looking out for tomorrow? Who is doing the long term planning? Instead of our snake oil salesmen, who is selling long term stability/flexibility. Is it even possible to make money when thinking about the long term. Is there money for the conservative visionary or is it only for the radical lose cannon. I guess I really ought to set up a web maintenance company for all of these businesses that are
Re: [PHP] need help with code
Code without proper indentation and is very hard to comprehend. You have unnecessary spacing and line breaks that makes it difficult to debug. I suggest you few things as a good practice: 1) Until you learn perfectly to code use some nice GUI editors that have syntax highlighting (aptana, eclipse, zend etc). 2) Don't try to mix up markup (html) and api calls(PHP Code). Believe it become a horrible mess to maintain after some point. Anyways Here is your code with parse error removed: ?php require_once('twitterlib.php'); $consumerKey=yVVRd1QCJYBtT8tT7ocg; $consumerSecret=DHzhJYOP2hBWfHpHawGxRQEFf98nF4TBTfabel2ukE; $accessToken = $_COOKIE['accessToken']; $reqToken = $_COOKIE['reqToken']; if($accessToken===NULL){ if ($reqToken === NULL){ //get a req token $to = new TwitterOAuth($consumerKey, $consumerSecret); $tok = $to-getRequestToken(); $reqToken = $tok['oauth_token']; $reqTokenSecret = $tok['oauth_token_secret']; $request_link = $to-getAuthorizeURL($toc); $content = 'Click on the link to go to twitter to authorize your account.'; $content .= 'br /a href='.$request_link.''.$request_link.'/a'; setCookie('reqToken',$reqToken,time()+(24*30*60*60),'/'); setCookie('reqTokenSecret',$reqTokenSecret,time()+(24*30*60*60),'/'); ? htmlheadtitleauthorize/title/headbody ?php echo $content;? /body/html ?php }else{ /* If the access tokens are already set skip to the API call */ if ($_COOKIE['accessToken']===NULL){ /* Create TwitterOAuth object with app key/secret and token key/secret from default phase */ $to = new TwitterOAuth($consumerKey,$consumerSecret,$_COOKIE['reqToken'],$_COOKIE['reqTokenSecret']); /* Request access tokens from twitter */ $tok = $to-getAccessToken(); /* Save the access tokens. Normally these would be saved in a database for future use.*/ setCookie('accessToken',$tok['oauth_token'],time()*24*60*60*30+3600,'/'); setCookie('accessTokenSecret',$tok['oauth_token_secret'],time()*24*60*60*30,'/'); header(location http://www.chriswestbrook.com/twitter/twitter.php;); } } } ? Thanks, V