RE: [PHP] New to PHP question
On Wed, 2009-01-28 at 23:42 +, Ashley Sheridan wrote: I hate div'itis as well. Some people seem to think it's a big faux pas to use table tags now, when that couldn't be more wrong. Use tables for tabular data, CSS for the rest (with as few exceptions - and there are always some eh - as you can manage.) I've seen people try to rebuild a table of data, that you might represent in a spreadsheet, as a collection of div's. Bad form, as the data has now lost all meaning. This is the same as replacing all your h1 tags with div class=header1 or strong with span class=bold. Silly idea, slap on the wrist, don't do it again. Personally, CSS is my preferred way of working now. I can define a whole bunch of elements, semantically as possible, and then can redefine the look as often as I wish afterwards with CSS. Look at the CSS Zen Garden if you don't believe how useful this is. Rather than going through a bunch of page to replaces tables, or PHP code to change the output layout, you can redefine your CSS to alter the look. It's not a black art, it just needs a little practise. Remember how bad we all were when we first started using HTML? It's exactly the same thing here! I thought I'd dredge up this old, old topic to add some comments about some recent stuff I did since this thread (or many similar to it) were in the back of mind. Specifically I was creating a new look and feel for my MUD hobby website and I wanted to make use of lots of PNG images with alpha transparency. Additionally I wanted variable width. I felt tables were the best approach for this because div based sliding door techniques and multi-level div containers don't work when the alpha transparency will reveal the underlying sliding or container background. I just don't think I could accomplish the same results using divs and floats. http://www.wocmud.org/welcome.php Comments? 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] New to PHP question
Don Collier wrote: First, when I use the \n and run the script from the command line it works great. When I run the same code in a browser it does not put the newline in and the text runs together. I know that I can use br/ to do the same thing, but why is it this way? That's how HTML works. The second question is closely related to the first. When formatting text using printf the padding works great when running from the command line but not at all when in a browser. Same answer. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
Don Collier wrote: I am just learning PHP from the O'Reilly Learning PHP 5 book and I have a question regarding the formatting of text. Actually it is a couple of questions. First, when I use the \n and run the script from the command line it works great. When I run the same code in a browser it does not put the newline in and the text runs together. I know that I can use br/ to do the same thing, but why is it this way? The second question is closely related to the first. When formatting text using printf the padding works great when running from the command line but not at all when in a browser. Here is the code that I am working with: Browsers **only** support HTML. They do not understand things like \n to be anything special, so they just print as it is sent to the browser. Stephen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, Jan 28, 2009 at 12:05:34PM -0700, Don Collier wrote: I am just learning PHP from the O'Reilly Learning PHP 5 book and I have a question regarding the formatting of text. Actually it is a couple of questions. First, when I use the \n and run the script from the command line it works great. When I run the same code in a browser it does not put the newline in and the text runs together. I know that I can use br/ to do the same thing, but why is it this way? Browser don't break lines on the \n character. They only break on br or p tags. That's just the way it is. You can use the PHP function nl2br() to insert br tags where the \n characters are. The second question is closely related to the first. When formatting text using printf the padding works great when running from the command line but not at all when in a browser. Browsers don't respect multiple spaces, etc., except in between certain tags, like pre/pre. Instead, they combine multiple spaces into a single space and break lines where they like, based on layout. You can use the HTML nbsp; character if you don't want lines or phrases to break at the whim of the browser. If you want exact layout (columns lined up, etc.), the simplest solution is to use HTML tables. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
Paul M Foster wrote: If you want exact layout (columns lined up, etc.), the simplest solution is to use HTML tables. The horror. Do not use tables for layout. Use CSS. Especially now that Microsoft, just this week, is sending out IE 8 which seems to be fully CCS standards compliant. Stephen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, 2009-01-28 at 14:40 -0500, Stephen wrote: Especially now that Microsoft, just this week, is sending out IE 8 which seems to be fully CCS standards compliant. *snigger* I'll believe that when I see it, rather I give it to you oh web developers everywhere, that this is just a new M$ standard of CSS! Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
Paul M Foster wrote: On Wed, Jan 28, 2009 at 12:05:34PM -0700, Don Collier wrote: I am just learning PHP from the O'Reilly Learning PHP 5 book and I have a question regarding the formatting of text. Actually it is a couple of questions. First, when I use the \n and run the script from the command line it works great. When I run the same code in a browser it does not put the newline in and the text runs together. I know that I can use br/ to do the same thing, but why is it this way? Browser don't break lines on the \n character. They only break on br or p tags. That's just the way it is. You can use the PHP function nl2br() to insert br tags where the \n characters are. The second question is closely related to the first. When formatting text using printf the padding works great when running from the command line but not at all when in a browser. Browsers don't respect multiple spaces, etc., except in between certain tags, like pre/pre. Instead, they combine multiple spaces into a single space and break lines where they like, based on layout. You can use the HTML nbsp; character if you don't want lines or phrases to break at the whim of the browser. If you want exact layout (columns lined up, etc.), the simplest solution is to use HTML tables. Paul Thanks to everyone that responded. From what I am seeing in the responses if I plan on using php for command line scripts things get written one way. If, on the other hand, the php is written for a web page it gets written a slightly different way inserting html where necessary for formatting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, Jan 28, 2009 at 2:58 PM, Don Collier dcoll...@collierclan.comwrote: Paul M Foster wrote: On Wed, Jan 28, 2009 at 12:05:34PM -0700, Don Collier wrote: I am just learning PHP from the O'Reilly Learning PHP 5 book and I have a question regarding the formatting of text. Actually it is a couple of questions. First, when I use the \n and run the script from the command line it works great. When I run the same code in a browser it does not put the newline in and the text runs together. I know that I can use br/ to do the same thing, but why is it this way? Browser don't break lines on the \n character. They only break on br or p tags. That's just the way it is. You can use the PHP function nl2br() to insert br tags where the \n characters are. The second question is closely related to the first. When formatting text using printf the padding works great when running from the command line but not at all when in a browser. Browsers don't respect multiple spaces, etc., except in between certain tags, like pre/pre. Instead, they combine multiple spaces into a single space and break lines where they like, based on layout. You can use the HTML nbsp; character if you don't want lines or phrases to break at the whim of the browser. If you want exact layout (columns lined up, etc.), the simplest solution is to use HTML tables. Paul Thanks to everyone that responded. From what I am seeing in the responses if I plan on using php for command line scripts things get written one way. If, on the other hand, the php is written for a web page it gets written a slightly different way inserting html where necessary for formatting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Not quite true in a properly layered application. Separating the data from the display (whatever that is) is prime idea behind the MVC (Model View Controller) design pattern. This way your code that runs via the CLI (command line) can produce the same data as the code that gets the data for the HTML. The only difference is what you plan to do with that data. You could feed it to a controller and let the controller feed it to a View to render in a browser, or send it to a FileOutput class to create a file of the data for comsumption by another resource. -- Bastien Cat, the other other white meat
Re: [PHP] New to PHP question
2009/1/28 Stephen stephe...@rogers.com: Don Collier wrote: I am just learning PHP from the O'Reilly Learning PHP 5 book and I have a question regarding the formatting of text. Actually it is a couple of questions. First, when I use the \n and run the script from the command line it works great. When I run the same code in a browser it does not put the newline in and the text runs together. I know that I can use br/ to do the same thing, but why is it this way? The second question is closely related to the first. When formatting text using printf the padding works great when running from the command line but not at all when in a browser. Here is the code that I am working with: Browsers **only** support HTML. They do not understand things like \n to be anything special, so they just print as it is sent to the browser. ?php header('Content-Type: text/plain'); echo That's\n; echo Not\n; echo Entirely\n; echo Accurate.; ? -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
Don Collier wrote: From what I am seeing in the responses if I plan on using php for command line scripts things get written one way. If, on the other hand, the php is written for a web page it gets written a slightly different way inserting html where necessary for formatting. No, the scripts are written the same way, but you are using two different output media, so your output must be different. Like Stuart said - if you want your browser to output in text-mode, just set the right header-type. (text/plain). /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, Jan 28, 2009 at 02:40:55PM -0500, Stephen wrote: Paul M Foster wrote: If you want exact layout (columns lined up, etc.), the simplest solution is to use HTML tables. The horror. Do not use tables for layout. Use CSS. Especially now that Microsoft, just this week, is sending out IE 8 which seems to be fully CCS standards compliant. I'm happy to be a Luddite in this area. We've been doing websites for about ten years, and have yet to find it either simple or easy to get exact, gracefully-degrading layouts with CSS. (We use CSS for all kinds of nifty things, but not to line things up properly.) Hey, I've got an idea. If someone knows of one of these uber-web-design authorities who writes books touting the superiority of CSS over tables, have them write a book showing us all how it's done [easily]. I'll be first in line to buy it, because I agree that page layout is not the original proper use of tables. Paul PS: I have to snicker as well anytime Microsoft says they're compliant with *any* standard. Their history speaks for itself; why should we believe them now? -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, Jan 28, 2009 at 03:06:36PM -0500, Bastien Koert wrote: On Wed, Jan 28, 2009 at 2:58 PM, Don Collier dcoll...@collierclan.comwrote: On Wed, Jan 28, 2009 at 12:05:34PM -0700, Don Collier wrote: I am just learning PHP from the O'Reilly Learning PHP 5 book and I have a question regarding the formatting of text. Actually it is a couple of questions. First, when I use the \n and run the script from the command line it works great. When I run the same code in a browser it does not put the newline in and the text runs together. I know that I can use br/ to do the same thing, but why is it this way? snip Thanks to everyone that responded. From what I am seeing in the responses if I plan on using php for command line scripts things get written one way. If, on the other hand, the php is written for a web page it gets written a slightly different way inserting html where necessary for formatting. snip Not quite true in a properly layered application. Separating the data from the display (whatever that is) is prime idea behind the MVC (Model View Controller) design pattern. This way your code that runs via the CLI (command line) can produce the same data as the code that gets the data for the HTML. The only difference is what you plan to do with that data. You could feed it to a controller and let the controller feed it to a View to render in a browser, or send it to a FileOutput class to create a file of the data for comsumption by another resource. See? This is what I'm talking about. *I* understand what you're saying, Don, and I agree. But this guy is just learning PHP from what is arguably not one of the best books on PHP (IMO). And you're throwing MVC at him. Let him master the subtleties of the language first, then we'll give him the MVC speech. Yes, I know, they should learn proper programming practices from the beginning, blah blah blah. But think back to the first programming language you ever learned, when you were first learning it. If someone had thrown stuff like this at you, would you have had a clue? I had enough trouble just learning the proper syntax and library routines for Dartmouth BASIC and Pascal, without having to deal with a lot of metaprogramming stuff. This is the problem when you get newbies asking questions on a list whose membership includes hardcore gurus. The gurus look at things in such a lofty way that answering simple questions at the level of a beginner sounds like a dissertation on the subtleties of Spanish art in the 1500s. Just my opinion. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
Is there any advantage to using CSS over table and would it be idea to go to past website and change them. /Ernie - Original Message - From: Stephen stephe...@rogers.com Newsgroups: php.general To: Paul M Foster pa...@quillandmouse.com Cc: php-general@lists.php.net Sent: Wednesday, January 28, 2009 2:40 PM Subject: Re: [PHP] New to PHP question Paul M Foster wrote: If you want exact layout (columns lined up, etc.), the simplest solution is to use HTML tables. The horror. Do not use tables for layout. Use CSS. Especially now that Microsoft, just this week, is sending out IE 8 which seems to be fully CCS standards compliant. Stephen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, Jan 28, 2009 at 3:28 PM, Paul M Foster pa...@quillandmouse.comwrote: On Wed, Jan 28, 2009 at 03:06:36PM -0500, Bastien Koert wrote: On Wed, Jan 28, 2009 at 2:58 PM, Don Collier dcoll...@collierclan.com wrote: On Wed, Jan 28, 2009 at 12:05:34PM -0700, Don Collier wrote: I am just learning PHP from the O'Reilly Learning PHP 5 book and I have a question regarding the formatting of text. Actually it is a couple of questions. First, when I use the \n and run the script from the command line it works great. When I run the same code in a browser it does not put the newline in and the text runs together. I know that I can use br/ to do the same thing, but why is it this way? snip Thanks to everyone that responded. From what I am seeing in the responses if I plan on using php for command line scripts things get written one way. If, on the other hand, the php is written for a web page it gets written a slightly different way inserting html where necessary for formatting. snip Not quite true in a properly layered application. Separating the data from the display (whatever that is) is prime idea behind the MVC (Model View Controller) design pattern. This way your code that runs via the CLI (command line) can produce the same data as the code that gets the data for the HTML. The only difference is what you plan to do with that data. You could feed it to a controller and let the controller feed it to a View to render in a browser, or send it to a FileOutput class to create a file of the data for comsumption by another resource. See? This is what I'm talking about. *I* understand what you're saying, Don, and I agree. But this guy is just learning PHP from what is arguably not one of the best books on PHP (IMO). And you're throwing MVC at him. Let him master the subtleties of the language first, then we'll give him the MVC speech. Yes, I know, they should learn proper programming practices from the beginning, blah blah blah. But think back to the first programming language you ever learned, when you were first learning it. If someone had thrown stuff like this at you, would you have had a clue? I had enough trouble just learning the proper syntax and library routines for Dartmouth BASIC and Pascal, without having to deal with a lot of metaprogramming stuff. This is the problem when you get newbies asking questions on a list whose membership includes hardcore gurus. The gurus look at things in such a lofty way that answering simple questions at the level of a beginner sounds like a dissertation on the subtleties of Spanish art in the 1500s. Just my opinion. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Paul, You make a valid point, but I suggest that once you get beyonds the basics of programming (loops, if then else, do while etc) and granted that I do not know where the OP sits in this area, it would have saved me many hours of frustration, having to unlearn what I know and force feed myself a new paradigm. To me its kind of 6 of one and half a dozen of the other...but the requirement is having that basic programming knowledge that gives a solid foundation to any language. My 2 cents... -- Bastien Cat, the other other white meat
Re: [PHP] New to PHP question
Paul M Foster wrote: See? This is what I'm talking about. *I* understand what you're saying, Don, and I agree. But this guy is just learning PHP from what is arguably not one of the best books on PHP (IMO). And you're throwing MVC at him. Let him master the subtleties of the language first, then we'll give him the MVC speech. Yes, I know, they should learn proper programming practices from the beginning, blah blah blah. But think back to the first programming language you ever learned, when you were first learning it. If someone had thrown stuff like this at you, would you have had a clue? I had enough trouble just learning the proper syntax and library routines for Dartmouth BASIC and Pascal, without having to deal with a lot of metaprogramming stuff. This is the problem when you get newbies asking questions on a list whose membership includes hardcore gurus. The gurus look at things in such a lofty way that answering simple questions at the level of a beginner sounds like a dissertation on the subtleties of Spanish art in the 1500s. Just my opinion. Paul On that note, what would be a better book to learn from? I have always been a fan of the O'Reilly books, but I am open to differing flavors of kool-aid. One can never have too many resources. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
Don Collier dcoll...@collierclan.com wrote in message news:4980c3d3.8040...@collierclan.com... Paul M Foster wrote: See? This is what I'm talking about. *I* understand what you're saying, Don, and I agree. But this guy is just learning PHP from what is arguably not one of the best books on PHP (IMO). And you're throwing MVC at him. Let him master the subtleties of the language first, then we'll give him the MVC speech. Yes, I know, they should learn proper programming practices from the beginning, blah blah blah. But think back to the first programming language you ever learned, when you were first learning it. If someone had thrown stuff like this at you, would you have had a clue? I had enough trouble just learning the proper syntax and library routines for Dartmouth BASIC and Pascal, without having to deal with a lot of metaprogramming stuff. This is the problem when you get newbies asking questions on a list whose membership includes hardcore gurus. The gurus look at things in such a lofty way that answering simple questions at the level of a beginner sounds like a dissertation on the subtleties of Spanish art in the 1500s. Just my opinion. Paul On that note, what would be a better book to learn from? I have always been a fan of the O'Reilly books, but I am open to differing flavors of kool-aid. One can never have too many resources. First of all...for **insert deities name here** sake don't drink the kool-aid! I started with the visual series of books just to get the hang of the rudimentry language, and then went right to the online php manual. www. devguru. com isn't bad, but tends to be a bit sparse on explinations. If you are familliar with any programming language google is your friend. php is pretty close to c for ease of refference so googling for like 'switch php' brings up loads of examples and refs. I still don't know anything about this pear, or other frameworks they speak of on here, but I'm sure I will learn it in time. :) Personally I think French art from the 1500's was better any way. Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, 2009-01-28 at 13:45 -0700, Don Collier wrote: Paul M Foster wrote: See? This is what I'm talking about. *I* understand what you're saying, Don, and I agree. But this guy is just learning PHP from what is arguably not one of the best books on PHP (IMO). And you're throwing MVC at him. Let him master the subtleties of the language first, then we'll give him the MVC speech. Yes, I know, they should learn proper programming practices from the beginning, blah blah blah. But think back to the first programming language you ever learned, when you were first learning it. If someone had thrown stuff like this at you, would you have had a clue? I had enough trouble just learning the proper syntax and library routines for Dartmouth BASIC and Pascal, without having to deal with a lot of metaprogramming stuff. This is the problem when you get newbies asking questions on a list whose membership includes hardcore gurus. The gurus look at things in such a lofty way that answering simple questions at the level of a beginner sounds like a dissertation on the subtleties of Spanish art in the 1500s. Just my opinion. Paul On that note, what would be a better book to learn from? I have always been a fan of the O'Reilly books, but I am open to differing flavors of kool-aid. One can never have too many resources. I agree with your choice; never seen a bad O'Reilly book yet. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, 2009-01-28 at 15:17 -0500, Paul M Foster wrote: On Wed, Jan 28, 2009 at 02:40:55PM -0500, Stephen wrote: Paul M Foster wrote: If you want exact layout (columns lined up, etc.), the simplest solution is to use HTML tables. The horror. Do not use tables for layout. Use CSS. Especially now that Microsoft, just this week, is sending out IE 8 which seems to be fully CCS standards compliant. I'm happy to be a Luddite in this area. We've been doing websites for about ten years, and have yet to find it either simple or easy to get exact, gracefully-degrading layouts with CSS. (We use CSS for all kinds of nifty things, but not to line things up properly.) Hey, I've got an idea. If someone knows of one of these uber-web-design authorities who writes books touting the superiority of CSS over tables, have them write a book showing us all how it's done [easily]. I'll be first in line to buy it, because I agree that page layout is not the original proper use of tables. Paul PS: I have to snicker as well anytime Microsoft says they're compliant with *any* standard. Their history speaks for itself; why should we believe them now? -- Paul M. Foster I use CSS as much as possible, and it's second nature to me now to design with CSS rather than tables, but the only area I find it quicker to use tables is when I design forms. I know I'm going to browser hell, but meh, I can deal with it! :p Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, 2009-01-28 at 15:33 -0500, Ernie Kemp wrote: Is there any advantage to using CSS over table and would it be idea to go to past website and change them. /Ernie - Original Message - From: Stephen stephe...@rogers.com Newsgroups: php.general To: Paul M Foster pa...@quillandmouse.com Cc: php-general@lists.php.net Sent: Wednesday, January 28, 2009 2:40 PM Subject: Re: [PHP] New to PHP question Paul M Foster wrote: If you want exact layout (columns lined up, etc.), the simplest solution is to use HTML tables. The horror. Do not use tables for layout. Use CSS. Especially now that Microsoft, just this week, is sending out IE 8 which seems to be fully CCS standards compliant. Stephen Some browsers (IE) need the entire table to load before it can begin to display it. Note this is only the whole table, not it's contents, so it may appear to jump around as images, etc load in. Also, pages with lots and lots of nested tables do render slightly more slowly, but these at worst is going to be a second or two. Tables are great for tabular layout, but divs when used properly an be a lot more flexible and forgiving. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, Jan 28, 2009 at 1:26 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: I use CSS as much as possible, and it's second nature to me now to design with CSS rather than tables, but the only area I find it quicker to use tables is when I design forms. I know I'm going to browser hell, but meh, I can deal with it! :p I've had the same pain. If I want to get something up quick, I wind up doing it in tables. I have some basic CSS templates I can get up, but for forms and some other things I wind up tweaking things over and over; with tables it's just done and I can move on. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] New to PHP question
-Original Message- From: Stephen [mailto:stephe...@rogers.com] Sent: Wednesday, January 28, 2009 1:41 PM To: Paul M Foster Cc: php-general@lists.php.net Subject: Re: [PHP] New to PHP question Paul M Foster wrote: If you want exact layout (columns lined up, etc.), the simplest solution is to use HTML tables. The horror. Do not use tables for layout. Use CSS. Especially now that Microsoft, just this week, is sending out IE 8 which seems to be fully CCS standards compliant. Your high horse--get off of it. Are you not familiar with div-itis? If I need to represent data in a grid-style layout, I am going to use a table every time instead of making tons of div elements and tying them into the appropriate CSS. http://www.giveupandusetables.com Also... as far as I know, XHTML 1.0 Strict and XHTML 1.1 still include the table tags. I can understand wanting to separate style from structure, but I think that tables are more structural than stylish. You have to draw the line somewhere. If you're displaying tabular data, use a table. If you just want stuff to be in a grid and the structure has no bearing on the content, then it's time to weigh in. Finally, just because IE8 is (supposed to be) fully CSS standards compliant doesn't mean anything for IE7, IE6, IE5, etc. // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
Boyd, Todd M. wrote: -Original Message- From: Stephen [mailto:stephe...@rogers.com] Sent: Wednesday, January 28, 2009 1:41 PM To: Paul M Foster Cc: php-general@lists.php.net Subject: Re: [PHP] New to PHP question Paul M Foster wrote: If you want exact layout (columns lined up, etc.), the simplest solution is to use HTML tables. The horror. Do not use tables for layout. Use CSS. Especially now that Microsoft, just this week, is sending out IE 8 which seems to be fully CCS standards compliant. Your high horse--get off of it. Are you not familiar with div-itis? If I need to represent data in a grid-style layout, I am going to use a table every time instead of making tons of div elements and tying them into the appropriate CSS. http://www.giveupandusetables.com Also... as far as I know, XHTML 1.0 Strict and XHTML 1.1 still include the table tags. I can understand wanting to separate style from structure, but I think that tables are more structural than stylish. You have to draw the line somewhere. If you're displaying tabular data, use a table. If you just want stuff to be in a grid and the structure has no bearing on the content, then it's time to weigh in. Finally, just because IE8 is (supposed to be) fully CSS standards compliant doesn't mean anything for IE7, IE6, IE5, etc. // Todd Or firefox for that matter. I tried to do a completely css site and when I got it looking great in ff/linux, it looked horrible in IE. Then when it looked better in IE and better in ff/linux, it had some issues iin ff/windows. I love tables and will use them for most layouts until they are removed from (x)html :-) -Shawn -- 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] New to PHP question
Boyd, Todd M. wrote: The horror. Do not use tables for layout. Use CSS. Especially now that Microsoft, just this week, is sending out IE 8 which seems to be fully CCS standards compliant. Your high horse--get off of it. Dude! Did you read what I wrote? I wrote do not use tables for layout! Are you not familiar with div-itis? If I need to represent data in a grid-style layout, I am going to use a table every time instead of making tons of div elements and tying them into the appropriate CSS. It you have tabular data to present, use HTML tables! That is what they are for. But use CSS to format the table. Finally, just because IE8 is (supposed to be) fully CSS standards compliant doesn't mean anything for IE7, IE6, IE5, etc. Microsoft is pushing IE 8 with their bug fix process. Not a bad idea to include a little JS to warm users with IE8 to upgrade. Stephen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] New to PHP question
-Original Message- From: Stephen [mailto:stephe...@rogers.com] Sent: Wednesday, January 28, 2009 4:40 PM Cc: php-general@lists.php.net Subject: Re: [PHP] New to PHP question Boyd, Todd M. wrote: Finally, just because IE8 is (supposed to be) fully CSS standards compliant doesn't mean anything for IE7, IE6, IE5, etc. Microsoft is pushing IE 8 with their bug fix process. Not a bad idea to include a little JS to warm users with IE8 to upgrade. If you're going to go that far, just ask them to install a worthwhile browser. :P It's sad, but the burden falls on us web developers to remain backwards-compatible (at least until EOL of the particular browser(s) in question). Personally, I look at that in the same light as I do pages that have a disclaimer at the bottom that says, Best viewed in SomeResolution with SomeBrowser. I understand that the programmer didn't want to go through the nightmare of getting it to work across-the-board, but your typical site visitor is going to look at that and frown. Also, with that in mind, remember that Microsoft does not design their web browser line with efficiency or speed of execution in mind. With each iterative release, there is more feature bloat, more memory required, and more processor cycles used up. Older PCs may very well be stuck with IE6. This may not be your target market, but it's something to consider. This is just my opinion... but I know I'm not alone. // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, Jan 28, 2009 at 01:45:07PM -0700, Don Collier wrote: On that note, what would be a better book to learn from? I have always been a fan of the O'Reilly books, but I am open to differing flavors of kool-aid. One can never have too many resources. The book that sits on my desk and is incredibly dog-eared is _Programming PHP_, also from O'Reilly. The whole back section is a reference on all the PHP functions and some extensions. The front part of the book explains nearly everything about the language. There are some errata in the book, which I've pointed out to O'Reilly, and when in doubt I check the function documentation on the php.net site. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, Jan 28, 2009 at 03:33:19PM -0500, Ernie Kemp wrote: Is there any advantage to using CSS over table and would it be idea to go to past website and change them. If it works, don't fix it. If you want to take the time to figure out how to get those same layouts in CSS, have a blast. But as you can see here from other replies, tables are the simplest choice for a lot of people who work with web pages all the time. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, Jan 28, 2009 at 09:26:10PM +, Ashley Sheridan wrote: snip I use CSS as much as possible, and it's second nature to me now to design with CSS rather than tables, but the only area I find it quicker to use tables is when I design forms. I know I'm going to browser hell, but meh, I can deal with it! :p That's my problem. Almost all the stuff I do is actual tabular data, or forms. Of course, the header and side bars are built with CSS. But the interior data are usually in tables. I've got forms with 50-odd fields in them, and I completely dispair of trying to make it look as good in CSS as it does in tables. Even with tables, I had more experimenting and colspans than you can imagine. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] New to PHP question
On Wed, 2009-01-28 at 16:05 -0600, Boyd, Todd M. wrote: -Original Message- From: Stephen [mailto:stephe...@rogers.com] Sent: Wednesday, January 28, 2009 1:41 PM To: Paul M Foster Cc: php-general@lists.php.net Subject: Re: [PHP] New to PHP question Paul M Foster wrote: If you want exact layout (columns lined up, etc.), the simplest solution is to use HTML tables. The horror. Do not use tables for layout. Use CSS. Especially now that Microsoft, just this week, is sending out IE 8 which seems to be fully CCS standards compliant. Your high horse--get off of it. Are you not familiar with div-itis? If I need to represent data in a grid-style layout, I am going to use a table every time instead of making tons of div elements and tying them into the appropriate CSS. http://www.giveupandusetables.com Also... as far as I know, XHTML 1.0 Strict and XHTML 1.1 still include the table tags. I can understand wanting to separate style from structure, but I think that tables are more structural than stylish. You have to draw the line somewhere. If you're displaying tabular data, use a table. If you just want stuff to be in a grid and the structure has no bearing on the content, then it's time to weigh in. Finally, just because IE8 is (supposed to be) fully CSS standards compliant doesn't mean anything for IE7, IE6, IE5, etc. // Todd I hate div'itis as well. Some people seem to think it's a big faux pas to use table tags now, when that couldn't be more wrong. Use tables for tabular data, CSS for the rest (with as few exceptions - and there are always some eh - as you can manage.) I've seen people try to rebuild a table of data, that you might represent in a spreadsheet, as a collection of div's. Bad form, as the data has now lost all meaning. This is the same as replacing all your h1 tags with div class=header1 or strong with span class=bold. Silly idea, slap on the wrist, don't do it again. Personally, CSS is my preferred way of working now. I can define a whole bunch of elements, semantically as possible, and then can redefine the look as often as I wish afterwards with CSS. Look at the CSS Zen Garden if you don't believe how useful this is. Rather than going through a bunch of page to replaces tables, or PHP code to change the output layout, you can redefine your CSS to alter the look. It's not a black art, it just needs a little practise. Remember how bad we all were when we first started using HTML? It's exactly the same thing here! Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
Paul M Foster wrote: On Wed, Jan 28, 2009 at 09:26:10PM +, Ashley Sheridan wrote: snip I use CSS as much as possible, and it's second nature to me now to design with CSS rather than tables, but the only area I find it quicker to use tables is when I design forms. I know I'm going to browser hell, but meh, I can deal with it! :p That's my problem. Almost all the stuff I do is actual tabular data, or forms. Of course, the header and side bars are built with CSS. But the interior data are usually in tables. I've got forms with 50-odd fields in them, and I completely dispair of trying to make it look as good in CSS as it does in tables. Even with tables, I had more experimenting and colspans than you can imagine. Paul see this is why i chant flex flex flex flex flex flex flex flex flex flex flex flex flex drumroll flx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
On Wed, Jan 28, 2009 at 11:41:31PM +, Nathan Rixham wrote: Paul M Foster wrote: On Wed, Jan 28, 2009 at 09:26:10PM +, Ashley Sheridan wrote: snip I use CSS as much as possible, and it's second nature to me now to design with CSS rather than tables, but the only area I find it quicker to use tables is when I design forms. I know I'm going to browser hell, but meh, I can deal with it! :p That's my problem. Almost all the stuff I do is actual tabular data, or forms. Of course, the header and side bars are built with CSS. But the interior data are usually in tables. I've got forms with 50-odd fields in them, and I completely dispair of trying to make it look as good in CSS as it does in tables. Even with tables, I had more experimenting and colspans than you can imagine. Paul see this is why i chant flex flex flex flex flex flex flex flex flex flex flex flex flex drumroll flx Oh, a proprietary protocol and set of tools meant to run on a proprietary platform, built by a company as rapacious as Microsoft, and whose applications can't be mined by search engines? Oh yeah, I'm there. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New to PHP question
Paul M Foster wrote: On Wed, Jan 28, 2009 at 01:45:07PM -0700, Don Collier wrote: On that note, what would be a better book to learn from? I have always been a fan of the O'Reilly books, but I am open to differing flavors of kool-aid. One can never have too many resources. The book that sits on my desk and is incredibly dog-eared is _Programming PHP_, also from O'Reilly. The whole back section is a reference on all the PHP functions and some extensions. The front part of the book explains nearly everything about the language. There are some errata in the book, which I've pointed out to O'Reilly, and when in doubt I check the function documentation on the php.net site. Paul I have this Learning PHP 5 and at the same time bought PHP and MySQL also from O'Reilly. Ever since my first Sed and Awk book from them about 10 or so years ago I have been hooked. I do have others in my library but I usually give them a shot first to see if I get what I need. I will have to pick up a copy of the Programming PHP and give it a look. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] new to php question
Luke Brindley mailto:[EMAIL PROTECTED] on Wednesday, March 10, 2004 10:37 AM said: Specifically, I want to create an online form that the booking agent can fill out with information like Date, Time, Cover Charge, Band Name, Description, etc and have this data populate the calendar page in chronological order. [snip] Any suggestions? are you looking for a premade app or did you have a specific question? here are some things to think about. 1. do you know how to create a database? 2. do you know how to write SQL queries? 3. do you know how to retrieve data from a database with php? if you answered no to any of those questions you are probably not ready to create such a thing. otherwise, ask a more specific question and we will try to help you out. hth, chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php