[PHP] Parse ini file problem
I am trying to parse an ini conf file using parse_ini_file but fails without returning something. I found this which is probably the reason: http://bugs.php.net/bug.php?id=44544 (the $ in the values) The problem is that this file has more than 7500 lines so it's kind of difficult to use quotes in all fields and there are several other reasons that I want to avoid quoting the values. In addition to that PHP 5.3 (which fixes this) is not stable yet and thus I can't install it in a production machine. So does anybody know any workarounds?? -- Thodoris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Software to read/write Excel to CD?
Matt Graham wrote: > Ashley Sheridan wrote: >> Paul M Foster wrote: >>> On Thu, May 14, 2009 at 03:22:12PM -0500, Skip Evans wrote: One of the things the other company said was possible, and I'm not familiar with... if I understand correctly, is to create a CD with not just an Excel spreadsheet, but software on that CD that when placed in another computer will open the spreadsheet, allow it to be modified and rewritten back to the CD. > > It has to be a CD-RW, the CD-RW has to be in UDF format, and the host > machine has to be able to read and rewrite CD-RWs in UDF. This is > actually not that tough to arrange--it just has nothing to do with > PHP. 'DozeXP should be able to do this, and Linux will do this if the > right kernel options are on. Don't know about OS X. > >>> Second, include some other program which >>> would do the same thing. Good luck with that. > > OOO Calc, which should be just fine for basic tasks and is Free. > >>> And now the kicker-- write the spreadsheet back to CD. Okay, maybe, if >>> it's a CD-RW. But who's going to pay attention to that little detail? >>> And as far as I know, writing to a CD is far more complicated than >>> writing to a hard drive. You can't overwrite data on a CD-RW. > > UDF, which has been a standard for quite some time, allows this. The > main thing you lose is some space on the CD-RW. > >> I've never heard of anything like that, there are so many unknown >> variables that I would really feel for the poor team who had to take >> that project on! > > It sounds like whoever defined the requirements was trying to solve a > problem in the wrong way. Why drag physical media into this when you > have the Net available? And if the clients don't have the Net > available, *why not*? > It *is* possible to be offline, and so far from anywhere that the only com links are to satellites... (expensive). I suspect that a USB key is a better option (and more physically portable) than a UFB CD. But why write an Excel spreadsheet - why not save the data in something more portable like CSV that ExCel and read and write to once you are back at base? -- Peter Ford phone: 01580 89 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php & html integration
On Thu, 2009-05-14 at 17:24 -0700, Michael A. Peters wrote: > tedd wrote: > > > > > > > > > > > > > and Hello World will be show as a H1 headline. > > > > Please note, the "()" seen in my use of echo is not necessary -- it's > > just another one of those things that I do that no one else does. It's > > not wrong, but it serves no purpose other than it looks good and makes > > sense *to me* YMMV. > > I do it that way as well. Me too... for require and include also. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: suggestion required
Hey thanks for your quick reply, Here is what i have done This is my flex code var issFront:ImageSnapshot = ImageSnapshot.captureImage(_model.productDesigner._boundingBox, dpi, new PNGEncoder(), false); var ba:ByteArray = issFront.data; ba.compress(); jpegBackProcessParams.jpegstreamFront = ba; first capturing image then converting into bytearray then compressing and then sending this parameter to PHP side using AMF-PHP This is my PHP side Code 1# way $data = $data["jpegstreamFront"]; $data = $data->data; $data = @gzuncompress($data); @file_put_contents("../../pictures_final/hello.png",$data); 2# way $data = $data["jpegstreamFront"]; $data = $data->data; $data = @gzuncompress($data);$fp = @fopen("../../pictures_final/hello.txt","w+"); @fwrite($fp,$data,strlen($data)); @fclose($fp); 1# way I tried generating Image directly from byte array ... 2# way I tried second way to store the byte array in text file and then generate 300 DPI image using file operation and file_put_contents .. In both case when Flex sends 300 Dpi size image around(2600x3000) And data depending upon the design in Image.. And the browser get hang... The issue is with sending Flex data to PHP side Once I got byte array data in PHP side its not a big deal to generate image.. Regards Pravin Chhasatiya -Original Message- From: Nathan Rixham [mailto:nrix...@gmail.com] Sent: Friday, May 15, 2009 3:21 AM To: Pravinc Cc: php-general@lists.php.net Subject: Re: suggestion required Pravinc wrote: > Hey all, > > I have one flex+PHP application. > > Main purpose of the site is to sell T-shirts online. > > > > Flex is used for generating different designs on available tshirt. > > Something similar to Cafepress dot com. > > > > I want to generate 300 DPI tshirt image from flex and send it to PHP side > for processing. > > Now the question is Flex doen't support direct image generation. > > So flex send's a Bytearray for 300 dpi image which is quite Bigger.some time > it crashes the browser while processing..because of heavy data.. > > > > And can not store in any of MySQL datatype. > > Also storing in a txt file is too much time taking process.. > > > > Any Suggestion or help to come out fron this issue.. > Hi, ByteArray should be fine, simply ensure you pack it before sending, then unpack it and read the floats back out with php to get the pixel values, you can then recompile with gd or suchlike (set pixel methods) and save as an image. Your alternative is to go with flash player 10 specific action script 3 and use vectors or fxg (on this note there are also some svg parsers for action script, 3rd party for fp9) - this approach will give you the same results but substantially less bytesize - whilst giving you no loss in quality seeing as they are vectors) one recommendation I would make is to use display objects throughout the process clientside, then BitmapData.draw( DisplayObject ) to a BitmapData, then getPixels on that to get your bytearray at the last minute. If you really come up short you can look at using alchemy to embed some C processing code in there, it really speeds up the process of working with huge ByteArrays as the c code is preoptimised and runs much faster. Many Regards, Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php & html integration
On Fri, 2009-05-15 at 05:42 -0400, Robert Cummings wrote: > On Thu, 2009-05-14 at 17:24 -0700, Michael A. Peters wrote: > > tedd wrote: > > > > > > > > > > > > > > > > > > > > and Hello World will be show as a H1 headline. > > > > > > Please note, the "()" seen in my use of echo is not necessary -- it's > > > just another one of those things that I do that no one else does. It's > > > not wrong, but it serves no purpose other than it looks good and makes > > > sense *to me* YMMV. > > > > I do it that way as well. > > Me too... for require and include also. Actually, I crossed mental threads there. I do echo without parenthesis but use them on require and include. 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] Software to read/write Excel to CD?
On Fri, May 15, 2009 at 10:21:22AM +0100, Peter Ford wrote: > Matt Graham wrote: > > Ashley Sheridan wrote: > >> Paul M Foster wrote: > >>> On Thu, May 14, 2009 at 03:22:12PM -0500, Skip Evans wrote: > One of the things the other company said was possible, and I'm > not familiar with... if I understand correctly, is to create a > CD with not just an Excel spreadsheet, but software on that CD > that when placed in another computer will open the > spreadsheet, allow it to be modified and rewritten back to the CD. > It *is* possible to be offline, and so far from anywhere that the only > com links > are to satellites... (expensive). > > I suspect that a USB key is a better option (and more physically portable) > than > a UFB CD. > > But why write an Excel spreadsheet - why not save the data in something more > portable like CSV that ExCel and read and write to once you are back at base? > CSV doesn't export *formulas*, just the visible numbers. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php & html integration
At 8:41 AM -0400 5/15/09, Robert Cummings wrote: On Fri, 2009-05-15 at 05:42 -0400, Robert Cummings wrote: On Thu, 2009-05-14 at 17:24 -0700, Michael A. Peters wrote: > tedd wrote: > > > > > > > > > > > > > and Hello World will be show as a H1 headline. > > > > Please note, the "()" seen in my use of echo is not necessary -- it's > > just another one of those things that I do that no one else does. It's > > not wrong, but it serves no purpose other than it looks good and makes > > sense *to me* YMMV. > > I do it that way as well. Me too... for require and include also. Actually, I crossed mental threads there. I do echo without parenthesis but use them on require and include. Rob et al: As Ron knows, both include() and echo() are language constructs and not functions. As such, parentheses are not needed around their arguments. However, for sake of readability (mine) and consistency in style (again mine) I use parentheses for both. I would fine it disturbing to use parentheses for one and not the other. Cheers, 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: php ssl connection timeout issue
On Thu, May 14, 2009 at 5:17 PM, Nathan Rixham wrote: > Jerry Zhao wrote: > >> On Thu, May 14, 2009 at 5:05 PM, Nathan Rixham wrote: >> >> Jerry Zhao wrote: >>> >>> I tried different combination of ssl clients and servers, it all points to problems on the client side of my new php build. The same code worked on an older php build. checked the output of print_r( stream_get_wrappers() );? >>> >> >> >> Array ( [0] => php [1] => file [2] => data [3] => http [4] => ftp [5] => >> compress.bzip2 [6] => https [7] => ftps [8] => compress.zlib ) >> >> > so you've got ssl support, next up you visited the url in a browser to > check the ssl certificate? odds are it's invalid and that an exception has > been made on the old php server No, the certificates are valid.
[PHP] textarea new line to mysql database
Hello, How do you guys handle this "problem". Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: "first line second line" when I edit the value in the form: "first line second line" when I output the value to html: "first linesecond line" (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? - visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ -- View this message in context: http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560478.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On Fri, 2009-05-15 at 07:03 -0700, PHPScriptor wrote: > Hello, > > How do you guys handle this "problem". > > Just a form with a textarea. When I use enters in the textarea it's saved to > the db like this: > > database: > "first line > second line" > > when I edit the value in the form: > "first line > second line" > > when I output the value to html: > "first linesecond line" (unless I use nl2br()) > > Is there a way that I could save it to the db that will work for db, output > and edit without using any other function like nl2br? Not to the DB, but it should respect newlines if you wrap it in tags. 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] textarea new line to mysql database
2009/5/15 PHPScriptor : > > Hello, > > How do you guys handle this "problem". > > Just a form with a textarea. When I use enters in the textarea it's saved to > the db like this: > > database: > "first line > second line" > > when I edit the value in the form: > "first line > second line" > > when I output the value to html: > "first linesecond line" (unless I use nl2br()) > > Is there a way that I could save it to the db that will work for db, output > and edit without using any other function like nl2br? What's your problem with using nl2br? This is the reason it exists!! Store the raw data in the database, and run nl2br on it when you display it. I don't see a "problem". -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
Well, instead of storing the text from the textarea directly into the db, validate it and wrap it with tags (replace \n) and then store it. This way you needn't use nl2br every time you retrieve the text from db. -Sterex On Fri, May 15, 2009 at 7:42 PM, Stuart wrote: > 2009/5/15 PHPScriptor : > > > > Hello, > > > > How do you guys handle this "problem". > > > > Just a form with a textarea. When I use enters in the textarea it's saved > to > > the db like this: > > > > database: > > "first line > > second line" > > > > when I edit the value in the form: > > "first line > > second line" > > > > when I output the value to html: > > "first linesecond line" (unless I use nl2br()) > > > > Is there a way that I could save it to the db that will work for db, > output > > and edit without using any other function like nl2br? > > What's your problem with using nl2br? This is the reason it exists!! > > Store the raw data in the database, and run nl2br on it when you > display it. I don't see a "problem". > > -Stuart > > -- > http://stut.net/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] textarea new line to mysql database
Mja, that's not my intention, in that case I also could use nl2br... Why does this problem exists? And why does it work with ? Is this a PHP problem or more a HTML problem? Robert Cummings wrote: > > On Fri, 2009-05-15 at 07:03 -0700, PHPScriptor wrote: >> Hello, >> >> How do you guys handle this "problem". >> >> Just a form with a textarea. When I use enters in the textarea it's saved >> to >> the db like this: >> >> database: >> "first line >> second line" >> >> when I edit the value in the form: >> "first line >> second line" >> >> when I output the value to html: >> "first linesecond line" (unless I use nl2br()) >> >> Is there a way that I could save it to the db that will work for db, >> output >> and edit without using any other function like nl2br? > > Not to the DB, but it should respect newlines if you wrap it in > tags. > > 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 > > > - visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ -- View this message in context: http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560765.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
Well, the problem is that I have a lot of forms, a lot of data to output, and even then, I don't know always where I have a textarea or just a inputfield. But true, I could even set the nl2br on an input field, it wouldn't make a difference. But I just don't understand why this problem exists? What's the reason? Stuart-47 wrote: > > 2009/5/15 PHPScriptor : >> >> Hello, >> >> How do you guys handle this "problem". >> >> Just a form with a textarea. When I use enters in the textarea it's saved >> to >> the db like this: >> >> database: >> "first line >> second line" >> >> when I edit the value in the form: >> "first line >> second line" >> >> when I output the value to html: >> "first linesecond line" (unless I use nl2br()) >> >> Is there a way that I could save it to the db that will work for db, >> output >> and edit without using any other function like nl2br? > > What's your problem with using nl2br? This is the reason it exists!! > > Store the raw data in the database, and run nl2br on it when you > display it. I don't see a "problem". > > -Stuart > > -- > http://stut.net/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > - visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ -- View this message in context: http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560853.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]Cannot output the same data from text file in PHP
At 4:45 PM -0400 5/14/09, Andrew Ballard wrote: On Thu, May 14, 2009 at 4:33 PM, Paul M Foster wrote: > My stance is, if you're going to subscribe to an email list, learn how to unsubscribe, how to see if you've been inadvertantly unsubscribed, > learn email netiquette on lists, etc. I agree with you for the most part. I'm just saying that the presence of unsubscribe information in the message headers themselves is of very little value to most people. Andrew: I'm sure you don't disagrees, but I side with Paul with this clarification: People who subscribe to this list do not fall in to the "most" people category. (proof -- think of Rob) :-) One must have some idea of what this list is about before subscribing to it. It's a deliberate act wherein the person has to travel from nonsubscriber to subscriber where along the way they are presented with information for them to read and agree as to what you are doing AND how to undo it. If they choose to ignore/forget that information then I claim that does not excuse them from the responsibilities they agreed to at the time of their subscription. Far too often in this current world of "political correctness" we must "feel" for the people who have made bad choices -- but I say "screw 'em" -- they should know better! :-) Cheers, 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] textarea new line to mysql database
Yes, I thought about that. But then you have a problem when you're going to 'edit' that data back in a form. Then you get "first linesecond line" in your textarea. Manoj Sterex wrote: > > Well, instead of storing the text from the textarea directly into the db, > validate it and wrap it with tags (replace \n) and then store it. > This way you needn't use nl2br every time you retrieve the text from db. > > -Sterex > > > On Fri, May 15, 2009 at 7:42 PM, Stuart wrote: > >> 2009/5/15 PHPScriptor : >> > >> > Hello, >> > >> > How do you guys handle this "problem". >> > >> > Just a form with a textarea. When I use enters in the textarea it's >> saved >> to >> > the db like this: >> > >> > database: >> > "first line >> > second line" >> > >> > when I edit the value in the form: >> > "first line >> > second line" >> > >> > when I output the value to html: >> > "first linesecond line" (unless I use nl2br()) >> > >> > Is there a way that I could save it to the db that will work for db, >> output >> > and edit without using any other function like nl2br? >> >> What's your problem with using nl2br? This is the reason it exists!! >> >> Store the raw data in the database, and run nl2br on it when you >> display it. I don't see a "problem". >> >> -Stuart >> >> -- >> http://stut.net/ >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > - visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ -- View this message in context: http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560882.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On Fri, 2009-05-15 at 19:48 +0530, Manoj Sterex wrote: > Well, instead of storing the text from the textarea directly into the db, > validate it and wrap it with tags (replace \n) and then store it. > This way you needn't use nl2br every time you retrieve the text from db. Don't do that unless it's a cached entry in the DB. Unless you absolutely know you'll never need the raw text again, you should always store the raw text so it can be processed in the future in any way you see fit. If you want to speed up the process of conversion, use an additional field in the database, or a cache, that contains the processed content. 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] textarea new line to mysql database
On Fri, May 15, 2009 at 07:03:49AM -0700, PHPScriptor wrote: > > Hello, > > How do you guys handle this "problem". > > Just a form with a textarea. When I use enters in the textarea it's saved to > the db like this: > > database: > "first line > second line" > > when I edit the value in the form: > "first line > second line" > > when I output the value to html: > "first linesecond line" (unless I use nl2br()) > > Is there a way that I could save it to the db that will work for db, output > and edit without using any other function like nl2br? If I understand your question, the answer is no. If you have wrap="hard" as an attribute for your textarea, it will store the data with CR/LF. But CR/LF don't show up as a line ending when displayed in HTML. You have to use nl2br() to translate for HTML. It also may be that you need to do a translation from CR/LF (textarea line ending) to LF (*nix line ending). The CR/LF *will* show up properly when *editing* in the textarea field, just not when displayed without a textarea. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
Well, its not exactly a 'problem' at all. The textarea just does what its meant to do - accept raw text input and lets you process it via form action. This is neither a PHP or a HTML 'problem'. The reason you cannot see the line breaks when you echo the text on your browser is the fact that the browser does not recognize '\n' as a line break; it only recognizes ''. Coming to the tag, stands for preformatted; it tells the browser to output the text in the raw format as it is. Hence it displays properly. -Sterex On Fri, May 15, 2009 at 7:54 PM, PHPScriptor wrote: > > Yes, I thought about that. But then you have a problem when you're going to > 'edit' that data back in a form. Then you get "first linesecond line" > in your textarea. > > > Manoj Sterex wrote: > > > > Well, instead of storing the text from the textarea directly into the db, > > validate it and wrap it with tags (replace \n) and then store it. > > This way you needn't use nl2br every time you retrieve the text from db. > > > > -Sterex > > > > > > On Fri, May 15, 2009 at 7:42 PM, Stuart wrote: > > > >> 2009/5/15 PHPScriptor : > >> > > >> > Hello, > >> > > >> > How do you guys handle this "problem". > >> > > >> > Just a form with a textarea. When I use enters in the textarea it's > >> saved > >> to > >> > the db like this: > >> > > >> > database: > >> > "first line > >> > second line" > >> > > >> > when I edit the value in the form: > >> > "first line > >> > second line" > >> > > >> > when I output the value to html: > >> > "first linesecond line" (unless I use nl2br()) > >> > > >> > Is there a way that I could save it to the db that will work for db, > >> output > >> > and edit without using any other function like nl2br? > >> > >> What's your problem with using nl2br? This is the reason it exists!! > >> > >> Store the raw data in the database, and run nl2br on it when you > >> display it. I don't see a "problem". > >> > >> -Stuart > >> > >> -- > >> http://stut.net/ > >> > >> -- > >> PHP General Mailing List (http://www.php.net/) > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > > > > > > > - > visit my website at http://www.phpscriptor.com/ > http://www.phpscriptor.com/ > -- > View this message in context: > http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560882.html > Sent from the PHP - General mailing list archive at Nabble.com. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] textarea new line to mysql database
@Robert: True. I was assuming that the text was going to be final and not being edited again. @PHPScriptor: If you do have a lot of textareas to work around with, why don't you give TinyMCE a try. Thats the best option you have got. It replaces the textarea into more of a html compatible one and when you are editing the text again, it will be properly formatted. You'll also get toolbars for text editing etc., more like your mail compose window right now. :) -Sterex On Fri, May 15, 2009 at 7:56 PM, Robert Cummings wrote: > On Fri, 2009-05-15 at 19:48 +0530, Manoj Sterex wrote: > > Well, instead of storing the text from the textarea directly into the db, > > validate it and wrap it with tags (replace \n) and then store it. > > This way you needn't use nl2br every time you retrieve the text from db. > > Don't do that unless it's a cached entry in the DB. Unless you > absolutely know you'll never need the raw text again, you should always > store the raw text so it can be processed in the future in any way you > see fit. If you want to speed up the process of conversion, use an > additional field in the database, or a cache, that contains the > processed content. > > 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] textarea new line to mysql database
TinyMCE: http://tinymce.moxiecode.com/ -Sterex On Fri, May 15, 2009 at 7:56 PM, Paul M Foster wrote: > On Fri, May 15, 2009 at 07:03:49AM -0700, PHPScriptor wrote: > > > > > Hello, > > > > How do you guys handle this "problem". > > > > Just a form with a textarea. When I use enters in the textarea it's saved > to > > the db like this: > > > > database: > > "first line > > second line" > > > > when I edit the value in the form: > > "first line > > second line" > > > > when I output the value to html: > > "first linesecond line" (unless I use nl2br()) > > > > Is there a way that I could save it to the db that will work for db, > output > > and edit without using any other function like nl2br? > > If I understand your question, the answer is no. If you have wrap="hard" > as an attribute for your textarea, it will store the data with CR/LF. > But CR/LF don't show up as a line ending when displayed in HTML. You > have to use nl2br() to translate for HTML. It also may be that you need > to do a translation from CR/LF (textarea line ending) to LF (*nix line > ending). The CR/LF *will* show up properly when *editing* in the > textarea field, just not when displayed without a textarea. > > Paul > > -- > Paul M. Foster > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] php & html integration
On Fri, May 15, 2009 at 9:38 AM, tedd wrote: > At 8:41 AM -0400 5/15/09, Robert Cummings wrote: > >> On Fri, 2009-05-15 at 05:42 -0400, Robert Cummings wrote: >> >>> On Thu, 2009-05-14 at 17:24 -0700, Michael A. Peters wrote: >>> > tedd wrote: >>> > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > and Hello World will be show as a H1 headline. >>> > > >>> > > Please note, the "()" seen in my use of echo is not necessary -- >>> it's >>> > > just another one of those things that I do that no one else does. >>> It's >>> > > not wrong, but it serves no purpose other than it looks good and >>> makes >>> > > sense *to me* YMMV. >>> > >>> > I do it that way as well. >>> >>> Me too... for require and include also. >>> >> >> Actually, I crossed mental threads there. I do echo without parenthesis >> but use them on require and include. >> > > Rob et al: > > As Ron knows, both include() and echo() are language constructs and not > functions. As such, parentheses are not needed around their arguments. > > However, for sake of readability (mine) and consistency in style (again > mine) I use parentheses for both. I would fine it disturbing to use > parentheses for one and not the other. > > Cheers, > > 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 > > But I always thought you were a bit distubed, tedd... i am disturbed too, since i do the same thing ;-) -- Bastien Cat, the other other white meat
Re: [PHP] textarea new line to mysql database
2009/5/15 PHPScriptor : > > Well, the problem is that I have a lot of forms, a lot of data to output, and > even then, I don't know always where I have a textarea or just a inputfield. > But true, I could even set the nl2br on an input field, it wouldn't make a > difference. > But I just don't understand why this problem exists? What's the reason? Trust me when I say in the grand scheme of things a call to nl2br is extremely cheap so I really wouldn't worry about how much you use it. If you don't know whether you're using a input field or a textarea I really think you need to examine your code carefully before proceeding. If you know to spit out a textarea then you know it's a textarea. Or maybe I'm missing something. The reason this "problem" exists is due to HTML compressing concurrent white space into a single space. This can be a very useful feature but is not immediately obvious to newcomers. If you're not familiar with HTML I suggest you put PHP down for a while and have a play with pure HTML - it'll be time well-invested. -Stuart -- http://stut.net/ > Stuart-47 wrote: >> >> 2009/5/15 PHPScriptor : >>> >>> Hello, >>> >>> How do you guys handle this "problem". >>> >>> Just a form with a textarea. When I use enters in the textarea it's saved >>> to >>> the db like this: >>> >>> database: >>> "first line >>> second line" >>> >>> when I edit the value in the form: >>> "first line >>> second line" >>> >>> when I output the value to html: >>> "first linesecond line" (unless I use nl2br()) >>> >>> Is there a way that I could save it to the db that will work for db, >>> output >>> and edit without using any other function like nl2br? >> >> What's your problem with using nl2br? This is the reason it exists!! >> >> Store the raw data in the database, and run nl2br on it when you >> display it. I don't see a "problem". >> >> -Stuart >> >> -- >> http://stut.net/ >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> > > > - > visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ > -- > View this message in context: > http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560853.html > Sent from the PHP - General mailing list archive at Nabble.com. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
At 7:22 AM -0700 5/15/09, PHPScriptor wrote: Well, the problem is that I have a lot of forms, a lot of data to output, and even then, I don't know always where I have a textarea or just a inputfield. But true, I could even set the nl2br on an input field, it wouldn't make a difference. But I just don't understand why this problem exists? What's the reason? Simply, the problem deals with how different systems handle the "end of line" (EOL) character? You can read more about it here: http://en.wikipedia.org/wiki/Newline What you've encountered (IMO) is just another extension/example of the problem. Now, your choices are to: 1. Listen to Rob (the wisest) and use the tag. 2. Listen to Stuart (the wisest) and use the nl2br() function 3. Listen to Sterex (IMO -- who is totally wrong) and put html in your database; 4. Or, listen to me (who is somewhere between Rob/Stuart and Sterex) and use either the tag or the nlbr() function depending upon what you want to do with the output. Both solutions [1 and 2] provide different ways to handle data. Number [3] simply creates another problem you, or someone else, will have to deal with later on. Cheers, 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] textarea new line to mysql database
@tedd: Its just another way of looking at the things. Putting HTML into the DB is not really wrong (perhaps in this context it is). If you do have HTML in the DB, you can directly echo it out and use CSS to style it accordingly. Just my 2 cents. :) -Sterex On Fri, May 15, 2009 at 8:24 PM, tedd wrote: > At 7:22 AM -0700 5/15/09, PHPScriptor wrote: > >> Well, the problem is that I have a lot of forms, a lot of data to output, >> and >> even then, I don't know always where I have a textarea or just a >> inputfield. >> But true, I could even set the nl2br on an input field, it wouldn't make a >> difference. >> But I just don't understand why this problem exists? What's the reason? >> > > > Simply, the problem deals with how different systems handle the "end of > line" (EOL) character? > > You can read more about it here: > > http://en.wikipedia.org/wiki/Newline > > What you've encountered (IMO) is just another extension/example of the > problem. > > Now, your choices are to: > > 1. Listen to Rob (the wisest) and use the tag. > > 2. Listen to Stuart (the wisest) and use the nl2br() function > > 3. Listen to Sterex (IMO -- who is totally wrong) and put html in your > database; > > 4. Or, listen to me (who is somewhere between Rob/Stuart and Sterex) and > use either the tag or the nlbr() function depending upon what you want > to do with the output. Both solutions [1 and 2] provide different ways to > handle data. Number [3] simply creates another problem you, or someone else, > will have to deal with later on. > > Cheers, > > 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] Spawn-FCGI, PHP-FPM
Hey, I'm looking into moving my site over to Nginx from apache. I've been reading up on how FastCGI works with PHP, and I've found two main solutions, either use spawn-fcgi or use php-fpm. However, it looks like there isn't any php-fpm code for the current stable version of PHP. Does anyone use php-fpm? Can you give me an intro to how it works? And is there a patch for php 5.2.9? Thanks for any help and suggestions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On Fri, 2009-05-15 at 10:54 -0400, tedd wrote: > At 7:22 AM -0700 5/15/09, PHPScriptor wrote: > >Well, the problem is that I have a lot of forms, a lot of data to output, and > >even then, I don't know always where I have a textarea or just a inputfield. > >But true, I could even set the nl2br on an input field, it wouldn't make a > >difference. > >But I just don't understand why this problem exists? What's the reason? > > > Simply, the problem deals with how different systems handle the "end > of line" (EOL) character? > > You can read more about it here: > > http://en.wikipedia.org/wiki/Newline > > What you've encountered (IMO) is just another extension/example of the > problem. > > Now, your choices are to: > > 1. Listen to Rob (the wisest) and use the tag. > > 2. Listen to Stuart (the wisest) and use the nl2br() function > > 3. Listen to Sterex (IMO -- who is totally wrong) and put html in > your database; > > 4. Or, listen to me (who is somewhere between Rob/Stuart and Sterex) > and use either the tag or the nlbr() function depending upon > what you want to do with the output. Both solutions [1 and 2] provide > different ways to handle data. Number [3] simply creates another > problem you, or someone else, will have to deal with later on. Actually, after reading the other posts with respect to what he's trying to do, I would use nl2br() unless I specifically needed . 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] textarea new line to mysql database
On Fri, May 15, 2009 at 07:19:24AM -0700, PHPScriptor wrote: > > Mja, that's not my intention, in that case I also could use nl2br... > > Why does this problem exists? And why does it work with ? Is this a PHP > problem or more a HTML problem? HTML doesn't recognize newlines when it displays text. The tag maintains the formatting of your original text, including newlines. Unfortunately, it also displays text in a monospace font. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]Cannot output the same data from text file in PHP
On Fri, May 15, 2009 at 10:24 AM, tedd wrote: > At 4:45 PM -0400 5/14/09, Andrew Ballard wrote: >> >> On Thu, May 14, 2009 at 4:33 PM, Paul M Foster >> wrote: >> > My stance is, if you're going to subscribe to an email list, learn how >>> >>> to unsubscribe, how to see if you've been inadvertantly unsubscribed, >> >> > learn email netiquette on lists, etc. >> >> I agree with you for the most part. I'm just saying that the presence >> of unsubscribe information in the message headers themselves is of >> very little value to most people. > > > Andrew: > > I'm sure you don't disagrees, but I side with Paul with this clarification: > People who subscribe to this list do not fall in to the "most" people > category. (proof -- think of Rob) :-) I agree, but I've subscribed and unsubscribed to a number of lists over the years, and I never knew anything about the unsubscribe headers for mailing list messages until someone mentioned them on this list. As such, I would never have looked there for information on how to unsubscribe. > One must have some idea of what this list is about before subscribing to it. > It's a deliberate act wherein the person has to travel from nonsubscriber to > subscriber where along the way they are presented with information for them > to read and agree as to what you are doing AND how to undo it. One would think. ;-) I know that at least part of the problem is that mailing lists vary so much depending on the software they use and the options specified by the list owners/managers. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On Fri, 2009-05-15 at 11:29 -0400, Paul M Foster wrote: > On Fri, May 15, 2009 at 07:19:24AM -0700, PHPScriptor wrote: > > > > > Mja, that's not my intention, in that case I also could use nl2br... > > > > Why does this problem exists? And why does it work with ? Is this a PHP > > problem or more a HTML problem? > > HTML doesn't recognize newlines when it displays text. The tag > maintains the formatting of your original text, including newlines. > Unfortunately, it also displays text in a monospace font. You can style a tag. 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] textarea new line to mysql database
At 8:38 PM +0530 5/15/09, Manoj Sterex wrote: @tedd: Its just another way of looking at the things. Putting HTML into the DB is not really wrong (perhaps in this context it is). If you do have HTML in the DB, you can directly echo it out and use CSS to style it accordingly. Just my 2 cents. :) -Sterex Thanks for taking my comment without flaming. What I said was based upon having to deal with clients who mix html and all sorts of stuff in their database and then wonder why certain pages look funny. They can't seem to grasp the concept of paired tags. To them means to make this section bold and quit somewhere it looks best. It's been an experience and that has left me with the opinion that civilians should stay the hell out of the programming -- just tell us what they want and not how to do it. Pardon my slant on things. Cheers, 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] textarea new line to mysql database
At 11:29 AM -0400 5/15/09, Paul M Foster wrote: On Fri, May 15, 2009 at 07:19:24AM -0700, PHPScriptor wrote: Mja, that's not my intention, in that case I also could use nl2br... Why does this problem exists? And why does it work with ? Is this a PHP problem or more a HTML problem? HTML doesn't recognize newlines when it displays text. The tag maintains the formatting of your original text, including newlines. Unfortunately, it also displays text in a monospace font. Paul I believe that you can override that with css. Cheers, 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] textarea new line to mysql database
PHPScriptor wrote: Hello, How do you guys handle this "problem". Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: "first line second line" when I edit the value in the form: "first line second line" when I output the value to html: "first linesecond line" (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? I run all text area through a filter that removes the carriage return [ preg_replace('/\r/','',$input) ] and save it in the database with any newline characters. When calling data from the database, I can then use newline as a delimiter for explode generate an array where each element of the array is a distinct line of text - and then do whatever I want with the lines. Effectively what I usually do is the same thing as nl2br - but since I do everything in DOMDocument I have to do it myself (create text nodes for each array element and create break nodes between them). If I'm going to a pre field or back to a text area (IE to edit the data) then I don't have to do anything. I do NOT recommend running nl2br before it goes into the database - as that means you may have to convert the breaks when re-using the data elsewhere, and the proper way to make a break depends upon the output type (IE for html or for xhtml, etc.) - so keep the newline character in the database and convert to what you need when you call the data from the database. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
At 11:19 AM -0400 5/15/09, Robert Cummings wrote: On Fri, 2009-05-15 at 10:54 -0400, tedd wrote: > 4. Or, listen to me (who is somewhere between Rob/Stuart and Sterex) and use either the tag or the nlbr() function depending upon what you want to do with the output. Both solutions [1 and 2] provide different ways to handle data. Number [3] simply creates another problem you, or someone else, will have to deal with later on. Actually, after reading the other posts with respect to what he's trying to do, I would use nl2br() unless I specifically needed . Cheers, Rob. -- That would be my first choice as well. However, one can style a tag whereas it's very difficult (if not impossible) to style what goes in between tags. Also, one can generate validation errors using "" because there are three different varieties of the tag, namely "", "", and "" -- all of which can be used in different settings. I don't remember which doctypes go with which version (xhtml requires />), but I've run into that problem before. Cheers, 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] Software to read/write Excel to CD?
Paul M Foster wrote: On Fri, May 15, 2009 at 10:21:22AM +0100, Peter Ford wrote: Matt Graham wrote: But why write an Excel spreadsheet - why not save the data in something more portable like CSV that ExCel and read and write to once you are back at base? CSV doesn't export *formulas*, just the visible numbers. gnumeric handles everything excel that I have ever needed, and is FOSS. I believe OpenOffice also does very well. That being said, you are more likely to find excel installed than either of those, excel is the spreadsheet standard at this point, and both those products mentioned handle most excel files, so saving as excel should (in most cases) be plenty portable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
tedd wrote: Also, one can generate validation errors using "" because there are three different varieties of the tag, namely "", "", and "" -- all of which can be used in different settings. I don't remember which doctypes go with which version (xhtml requires />), but I've run into that problem before. That's where DOMDocument helps - saveHTML() produces valid html break, saveXML() produces valid xhtml break, all from the same DOMDocument object. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Software to read/write Excel to CD?
On Fri, May 15, 2009 at 12:35 PM, Michael A. Peters wrote: > Paul M Foster wrote: > >> On Fri, May 15, 2009 at 10:21:22AM +0100, Peter Ford wrote: >> >> Matt Graham wrote: >>> >> > >>> But why write an Excel spreadsheet - why not save the data in something >>> more >>> portable like CSV that ExCel and read and write to once you are back at >>> base? >>> >>> >> CSV doesn't export *formulas*, just the visible numbers. >> > > gnumeric handles everything excel that I have ever needed, and is FOSS. > I believe OpenOffice also does very well. > > That being said, you are more likely to find excel installed than either of > those, excel is the spreadsheet standard at this point, and both those > products mentioned handle most excel files, so saving as excel should (in > most cases) be plenty portable. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > unless you run into xlsx format office 2007... -- Bastien Cat, the other other white meat
[PHP] CSS & tables
I know of no better place to ask. This may not be strictly a PHP issue, but... I am busting my hump trying to format rather large input pages with CSS and trying to avoid tables; but it looks to me like I am wasting my time as positioning with CSS seems an impossibly tortuous exercise. I've managed to do some pages with CSS, but I feel like I am shooting myself in the foot or somewhere... Perhaps I am too demanding. I know that with tables, the formatting is ridiculously fast. Any thoughts, observations or recommendations? -- Hervé Kempf: "Pour sauver la planète, sortez du capitalisme." - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
On Fri, 2009-05-15 at 13:25 -0400, PJ wrote: > I know of no better place to ask. This may not be strictly a PHP issue, > but... > I am busting my hump trying to format rather large input pages with CSS > and trying to avoid tables; but it looks to me like I am wasting my time > as positioning with CSS seems an impossibly tortuous exercise. I've > managed to do some pages with CSS, but I feel like I am shooting myself > in the foot or somewhere... > Perhaps I am too demanding. I know that with tables, the formatting is > ridiculously fast. > Any thoughts, observations or recommendations? Ask the guy paying you if he wants you to waste his money :) CSS is nice and all, but there are so many issues with getting layouts going that are so easy with tables. If only Microsoft would fully support the CSS rules for table layouts without tables then this would be a moot issue. But that hasn't happened yet (or has it in IE 8?). 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] CSS & tables
PJ wrote: I know of no better place to ask. This may not be strictly a PHP issue, but... I am busting my hump trying to format rather large input pages with CSS and trying to avoid tables; but it looks to me like I am wasting my time as positioning with CSS seems an impossibly tortuous exercise. I've managed to do some pages with CSS, but I feel like I am shooting myself in the foot or somewhere... Perhaps I am too demanding. I know that with tables, the formatting is ridiculously fast. Any thoughts, observations or recommendations? Whatever works best for you IMHO. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Software to read/write Excel to CD?
From: Bastien Koert > On Fri, May 15, 2009 at 12:35 PM, Michael A. Peters wrote: >> Paul M Foster wrote: >>> On Fri, May 15, 2009 at 10:21:22AM +0100, Peter Ford wrote: >>> >>> Matt Graham wrote: >>> >> But why write an Excel spreadsheet - why not save the data in something more portable like CSV that ExCel and read and write to once you are back at base? >>> CSV doesn't export *formulas*, just the visible numbers. >>> >> >> gnumeric handles everything excel that I have ever needed, and is FOSS. >> I believe OpenOffice also does very well. >> >> That being said, you are more likely to find excel installed than either of >> those, excel is the spreadsheet standard at this point, and both those >> products mentioned handle most excel files, so saving as excel should (in >> most cases) be plenty portable. > > unless you run into xlsx format office 2007... >From what I have heard so far, OOo.org is better at reading and writing xlsx than Office 2007 SP2 is with ODF. Early reviews suggest that Microsoft has shot themselves in the foot, again. But what does this have to do with PHP? Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
On 5/15/09 1:25 PM, "PJ" wrote: > I know of no better place to ask. This may not be strictly a PHP issue, > but... > I am busting my hump trying to format rather large input pages with CSS > and trying to avoid tables; but it looks to me like I am wasting my time > as positioning with CSS seems an impossibly tortuous exercise. I've > managed to do some pages with CSS, but I feel like I am shooting myself > in the foot or somewhere... > Perhaps I am too demanding. I know that with tables, the formatting is > ridiculously fast. > Any thoughts, observations or recommendations? there's a strong and vocal online faction advocating that tables should be avoided, especially for layout. it can get pretty extreme. there are influential voices that will denounce any that's used for other than semantic structure and then gets styled. it took me ages to realize that this isn't really very practical (at least not since ie5 became obsolete) and stop feeling that i was using bad practices. for one thing, a table is a great way of representing relations (http://mathworld.wolfram.com/Relation.html). data tables are the canonical example but very often a form's structure is a relation, e.g. between labels and input fields, or between multiple input fields. some of the best designed and behaving web sites i know use tables in ways that a list apart would consider heathen. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On 5/15/09 10:12 AM, "Stuart" wrote: > What's your problem with using nl2br? it's not multibyte safe. if you're using mb strings, e.g. for utf8 pages and forms, then use preg_replace (with the u modifier) instead of ml2br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
At 1:25 PM -0400 5/15/09, PJ wrote: I know of no better place to ask. This may not be strictly a PHP issue, but... I am busting my hump trying to format rather large input pages with CSS and trying to avoid tables; but it looks to me like I am wasting my time as positioning with CSS seems an impossibly tortuous exercise. I've managed to do some pages with CSS, but I feel like I am shooting myself in the foot or somewhere... Perhaps I am too demanding. I know that with tables, the formatting is ridiculously fast. Any thoughts, observations or recommendations? PJ: You have a choice: 1. Learn css and do it right; 2. Use tables. If you are in a time pinch, number 2 will suffice enough to get it past a client (besides, what do they know anyway). But number 1 is really the best way to go. Never use tables to hold a layout together. I know, I have clients who *require* me to use tables for their layout and I must bite my lip and comply. But, more and more clients are listening to reason as they discover it really is better way to go. Cheers, 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] textarea new line to mysql database
At 2:10 PM -0400 5/15/09, Tom Worster wrote: On 5/15/09 10:12 AM, "Stuart" wrote: What's your problem with using nl2br? it's not multibyte safe. if you're using mb strings, e.g. for utf8 pages and forms, then use preg_replace (with the u modifier) instead of ml2br Whoa -- and I thought you were just another pretty face. Good point. Cheers, 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] CSS & tables
At 2:06 PM -0400 5/15/09, Tom Worster wrote: for one thing, a table is a great way of representing relations (http://mathworld.wolfram.com/Relation.html). data tables are the canonical example but very often a form's structure is a relation, e.g. between labels and input fields, or between multiple input fields. some of the best designed and behaving web sites i know use tables in ways that a list apart would consider heathen. Heresy! :-) However, there are occasions such as in a calendar where not using a table would be more than difficult. I haven't received a decree yet as to IF that would be considered column data or not. I have, and continue to use, tables for forms. The main reason given for not using tables is because they are not considered accessible by those with disabilities. However, people with disabilities generally don't have any problems with forms if the forms are properly labeled. So, I think that's acceptable, but am sure heathen in css terms. But whenever/wherever I can, I try to avoid using tables -- especially in layouts. Cheers, 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: CSS & tables
PJ wrote: I know of no better place to ask. This may not be strictly a PHP issue, but... I am busting my hump trying to format rather large input pages with CSS and trying to avoid tables; but it looks to me like I am wasting my time as positioning with CSS seems an impossibly tortuous exercise. I've managed to do some pages with CSS, but I feel like I am shooting myself in the foot or somewhere... Perhaps I am too demanding. I know that with tables, the formatting is ridiculously fast. Any thoughts, observations or recommendations? Generally, if your content can vary somewhat, tables are easier. Browsers are very good at handling flow with tables. If the content is relatively constant, are best. Unfortunately DIVs behave differently if they are assigned a "position" element. Learn to use the various values. https://developer.mozilla.org/en/CSS/position Then learn to use Floats https://developer.mozilla.org/en/CSS/float Google, there are many good tutorials for floating divs. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
On Fri, 2009-05-15 at 14:11 -0400, tedd wrote: > At 1:25 PM -0400 5/15/09, PJ wrote: > >I know of no better place to ask. This may not be strictly a PHP issue, > >but... > >I am busting my hump trying to format rather large input pages with CSS > >and trying to avoid tables; but it looks to me like I am wasting my time > >as positioning with CSS seems an impossibly tortuous exercise. I've > >managed to do some pages with CSS, but I feel like I am shooting myself > >in the foot or somewhere... > >Perhaps I am too demanding. I know that with tables, the formatting is > >ridiculously fast. > >Any thoughts, observations or recommendations? > > PJ: > > You have a choice: > > 1. Learn css and do it right; > > 2. Use tables. > > If you are in a time pinch, number 2 will suffice enough to get it > past a client (besides, what do they know anyway). But number 1 is > really the best way to go. Never use tables to hold a layout together. > > I know, I have clients who *require* me to use tables for their > layout and I must bite my lip and comply. But, more and more clients > are listening to reason as they discover it really is better way to > go. Hi tedd, I made a post a week or so ago where I asked a question about a better way to do a layout... specifically I wrote the following... 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? I didn't get any feedback... maybe you have thoughts on it. I'm well versed in HTML and CSS and I felt the need to drop back to tables on that one (though I did use CSS appropriately). The WCAG have this to say on the matter: Checkpoints: 5.1 For data tables, identify row and column headers. [Priority 1] For example, in HTML, use TD to identify data cells and TH to identify headers. Techniques for checkpoint 5.1 5.2 For data tables that have two or more logical levels of row or column headers, use markup to associate data cells and header cells. [Priority 1] For example, in HTML, use THEAD, TFOOT, and TBODY to group rows, COL and COLGROUP to group columns, and the "axis", "scope", and "headers" attributes, to describe more complex relationships among data. Techniques for checkpoint 5.2 5.3 Do not use tables for layout unless the table makes sense when linearized. Otherwise, if the table does not make sense, provide an alternative equivalent (which may be a linearized version). [Priority 2] Note. Once user agents support style sheet positioning, tables should not be used for layout. Refer also to checkpoint 3.3. Techniques for checkpoint 5.3 5.4 If a table is used for layout, do not use any structural markup for the purpose of visual formatting. [Priority 2] For example, in HTML do not use the TH element to cause the content of a (non-table header) cell to be displayed centered and in bold. Techniques for checkpoint 5.4 5.5 Provide summaries for tables. [Priority 3] For example, in HTML, use the "summary" attribute of the TABLE element. Techniques for checkpoint 5.5 5.6 Provide abbreviations for header labels. [Priority 3] For example, in HTML, use the "abbr" attribute on the TH element. Techniques for checkpoint 5.6 It is my opinion that browsers do not yet provided the necessary functionality across a large enough user spectrum to facilitate the versatility of layouts used by many sites today. That said, I place most of the blame squarely on Microsoft. 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] CSS & tables
tedd wrote: > At 1:25 PM -0400 5/15/09, PJ wrote: >> I know of no better place to ask. This may not be strictly a PHP issue, >> but... >> I am busting my hump trying to format rather large input pages with CSS >> and trying to avoid tables; but it looks to me like I am wasting my time >> as positioning with CSS seems an impossibly tortuous exercise. I've >> managed to do some pages with CSS, but I feel like I am shooting myself >> in the foot or somewhere... >> Perhaps I am too demanding. I know that with tables, the formatting is >> ridiculously fast. >> Any thoughts, observations or recommendations? > > PJ: > > You have a choice: > > 1. Learn css and do it right; > > 2. Use tables. > > If you are in a time pinch, number 2 will suffice enough to get it > past a client (besides, what do they know anyway). But number 1 is > really the best way to go. Never use tables to hold a layout together. > > I know, I have clients who *require* me to use tables for their layout > and I must bite my lip and comply. But, more and more clients are > listening to reason as they discover it really is better way to go. > > Cheers, > > tedd > Thanks Tedd et al., for your input. I see that may limited experience was sufficient to understand what you are all saying: CSS is fine for graphical layouts even with some of the image limitations, but input/form and more than 1 column formatting is hell in CSS. So While I was awaiting your input, I set up my tables, had lunch and whistled Dixie. 8-) Oh, yes... the client was going up the wall with the time I was wasting with CSS... the client being myself. ;-) -- Hervé Kempf: "Pour sauver la planète, sortez du capitalisme." - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] CSS & tables
Um... sorry to jump in as a late arrival yet there you go What limitations? You could provide a layered layout using CSS and png graphic format. As for setting up columns check out float and clear and you're all set. TABLE, TR, TD, TBODY, etc were never intended to be used in the manner we see today. If you are blind and you hit a site with a mess of nested tables then.. well you might leave because of the garbage you have to listen to when the page loads. Speaking of which, correct me if I am wrong and my info is out of date but TABLEs are loaded one at a time by browsers and cause longer load times than necessary. All in CSS is the way to go. CSS3 will make our lives easier and will contain so many new features that it will be released in batches (modules) Sorry, I just couldn't read that statement about CSS being limited without speaking up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Information from ESET Smart Security, version of virus signature database 4080 (20090515) __ 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
Re: [PHP] CSS & tables
On Fri, 2009-05-15 at 14:59 -0400, PJ wrote: > tedd wrote: > > At 1:25 PM -0400 5/15/09, PJ wrote: > >> I know of no better place to ask. This may not be strictly a PHP issue, > >> but... > >> I am busting my hump trying to format rather large input pages with CSS > >> and trying to avoid tables; but it looks to me like I am wasting my time > >> as positioning with CSS seems an impossibly tortuous exercise. I've > >> managed to do some pages with CSS, but I feel like I am shooting myself > >> in the foot or somewhere... > >> Perhaps I am too demanding. I know that with tables, the formatting is > >> ridiculously fast. > >> Any thoughts, observations or recommendations? > > > > PJ: > > > > You have a choice: > > > > 1. Learn css and do it right; > > > > 2. Use tables. > > > > If you are in a time pinch, number 2 will suffice enough to get it > > past a client (besides, what do they know anyway). But number 1 is > > really the best way to go. Never use tables to hold a layout together. > > > > I know, I have clients who *require* me to use tables for their layout > > and I must bite my lip and comply. But, more and more clients are > > listening to reason as they discover it really is better way to go. > > > > Cheers, > > > > tedd > > > Thanks Tedd et al., for your input. > I see that may limited experience was sufficient to understand what you > are all saying: CSS is fine for graphical layouts even with some of the > image limitations, but input/form and more than 1 column formatting is > hell in CSS. So While I was awaiting your input, I set up my tables, had > lunch and whistled Dixie. 8-) > Oh, yes... the client was going up the wall with the time I was wasting > with CSS... the client being myself. ;-) There's a time for purism (such as in debate or mental exercise) and there's a time for pragmatism (such as when you're about to be fired for taking too long ;) 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] CSS & tables
On Fri, 2009-05-15 at 15:12 -0400, HallMarc Websites wrote: > Um... sorry to jump in as a late arrival yet there you go > > What limitations? You could provide a layered layout using CSS and png > graphic format. As for setting up columns check out float and clear and > you're all set. TABLE, TR, TD, TBODY, etc were never intended to be used in > the manner we see today. If you are blind and you hit a site with a mess of > nested tables then.. well you might leave because of the garbage you have to > listen to when the page loads. Speaking of which, correct me if I am wrong > and my info is out of date but TABLEs are loaded one at a time by browsers > and cause longer load times than necessary. > > All in CSS is the way to go. CSS3 will make our lives easier and will > contain so many new features that it will be released in batches (modules) > > Sorry, I just couldn't read that statement about CSS being limited without > speaking up. You must have missed the part about flexible width. Tell me how I prevent floated divs with alpha png backgrounds from revealing the underlying fill background alpha transparency PNG? I'd love to know. CSS3 will make our lives easier once it's fully supported by all major browser vendors... are you going to hit MS with a stick to get them going? 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] CSS & tables
On Fri, 2009-05-15 at 15:12 -0400, HallMarc Websites wrote: > Um... sorry to jump in as a late arrival yet there you go > > What limitations? You could provide a layered layout using CSS and png > graphic format. As for setting up columns check out float and clear and > you're all set. TABLE, TR, TD, TBODY, etc were never intended to be used in > the manner we see today. If you are blind and you hit a site with a mess of > nested tables then.. well you might leave because of the garbage you have to > listen to when the page loads. Speaking of which, correct me if I am wrong > and my info is out of date but TABLEs are loaded one at a time by browsers > and cause longer load times than necessary. > > All in CSS is the way to go. CSS3 will make our lives easier and will > contain so many new features that it will be released in batches (modules) > > Sorry, I just couldn't read that statement about CSS being limited without > speaking up. I should have commented on your other comments too... A table layout will generally not degrade the readability of the content for blind people if the content organized within is such that it will linearize. Similarly, this is true of nested tables. Browsers today are so fast and good at rendering HTML that you would need some very serious nesting to cause problems for the load time. I'm all for CSS, but I definitely think there are some deficiencies in the browser support currently. I've gone through all kinds of float hell for table-less layouts for government website HTML, that's fine, but by no means is it a walk in the park for all cases, especially where older browser compatibility is necessary. BTW, Google's homepage still uses a table layout. I'm sure there's a reason for it. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] read the last line in a file?
imagine writing a script to run as a daemon reading data off the bottom of a log file that gets updated every few minutes and processing each new log line as they arrive. i could exec("tail $logfile", $lines, $status) every now and then. or poll the file mtime and run exec("tail $logfile", $lines, $status) when it changes. there will be some lag due to the polling interval. but it would be nice to not have to poll the file and somehow trigger the processing of the new line when the log file is written. but i'm not sure how to do that. any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
Robert Cummings wrote: > On Fri, 2009-05-15 at 14:59 -0400, PJ wrote: > >> tedd wrote: >> >>> At 1:25 PM -0400 5/15/09, PJ wrote: >>> I know of no better place to ask. This may not be strictly a PHP issue, but... I am busting my hump trying to format rather large input pages with CSS and trying to avoid tables; but it looks to me like I am wasting my time as positioning with CSS seems an impossibly tortuous exercise. I've managed to do some pages with CSS, but I feel like I am shooting myself in the foot or somewhere... Perhaps I am too demanding. I know that with tables, the formatting is ridiculously fast. Any thoughts, observations or recommendations? >>> PJ: >>> >>> You have a choice: >>> >>> 1. Learn css and do it right; >>> >>> 2. Use tables. >>> >>> If you are in a time pinch, number 2 will suffice enough to get it >>> past a client (besides, what do they know anyway). But number 1 is >>> really the best way to go. Never use tables to hold a layout together. >>> >>> I know, I have clients who *require* me to use tables for their layout >>> and I must bite my lip and comply. But, more and more clients are >>> listening to reason as they discover it really is better way to go. >>> >>> Cheers, >>> >>> tedd >>> >>> >> Thanks Tedd et al., for your input. >> I see that may limited experience was sufficient to understand what you >> are all saying: CSS is fine for graphical layouts even with some of the >> image limitations, but input/form and more than 1 column formatting is >> hell in CSS. So While I was awaiting your input, I set up my tables, had >> lunch and whistled Dixie. 8-) >> Oh, yes... the client was going up the wall with the time I was wasting >> with CSS... the client being myself. ;-) >> > > There's a time for purism (such as in debate or mental exercise) and > there's a time for pragmatism (such as when you're about to be fired for > taking too long ;) > > Cheers, > Rob. > Yeah, I was about to fire myself. It's rather difficult to explain the contortions one has to go through to get what one wants with CSS. Sometimes you have to make so many exceptions (or variations on a theme) that the css file would become humungous. For instance, to align some 17 input rows to be aligned on the right for the prompt text and the input fields on the left with an "imaginary" line beween them... and then add separation lines between section of the inputs... You can force that in a small environment, but when you're getting into a complex (only in the backend) page; the output is rather simple but demanding. Tables got it done in no time at all; CSS you could play for a week and then... :-P -- Hervé Kempf: "Pour sauver la planète, sortez du capitalisme." - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
tedd wrote: At 2:06 PM -0400 5/15/09, Tom Worster wrote: for one thing, a table is a great way of representing relations (http://mathworld.wolfram.com/Relation.html). data tables are the canonical example but very often a form's structure is a relation, e.g. between labels and input fields, or between multiple input fields. some of the best designed and behaving web sites i know use tables in ways that a list apart would consider heathen. Heresy! :-) However, there are occasions such as in a calendar where not using a table would be more than difficult. I haven't received a decree yet as to IF that would be considered column data or not. I'm gonna differ on this one, when you simply float each calender item to the left you're pretty much done, in many cases i find it easier than tables. I have, and continue to use, tables for forms. The main reason given for not using tables is because they are not considered accessible by those with disabilities. However, people with disabilities generally don't have any problems with forms if the forms are properly labeled. So, I think that's acceptable, but am sure heathen in css terms. But whenever/wherever I can, I try to avoid using tables -- especially in layouts. IMHO the whole css vs table based layouts is a bit pointless, fact is that as web developers and designers we're struggling to fulfil clients needs, designers aesthetic demands and end user functionality using languages that really aren't cut out for the job. Sure we can manage to do and hack through things, but the second you move away from a conventional style document with some hyper links you've moved outside of the scope of html. So regardless of how we do it, we're fitting square technologies in to round holes. In fact the most fitting use of (x)HTML and CSS I've ever seen are the RFCs and Specifications on w3c.org - styled usable "documents" - not what many term as a website, and certainly not a flashy zippy glossy ecommerce store with a tonne of effects and even more functionality. It's a bit like creating a full glossy magazine in ms "paint" I guess. so ultimately i guess it's a case of 3 cheers and a round of applause for anybody who's thus far managed to create a website that works and that the client likes! regards :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
Robert Cummings wrote: > On Fri, 2009-05-15 at 15:12 -0400, HallMarc Websites wrote: > >> Um... sorry to jump in as a late arrival yet there you go >> >> What limitations? You could provide a layered layout using CSS and png >> graphic format. As for setting up columns check out float and clear and >> you're all set. TABLE, TR, TD, TBODY, etc were never intended to be used in >> the manner we see today. If you are blind and you hit a site with a mess of >> nested tables then.. well you might leave because of the garbage you have to >> listen to when the page loads. Speaking of which, correct me if I am wrong >> and my info is out of date but TABLEs are loaded one at a time by browsers >> and cause longer load times than necessary. >> >> All in CSS is the way to go. CSS3 will make our lives easier and will >> contain so many new features that it will be released in batches (modules) >> >> Sorry, I just couldn't read that statement about CSS being limited without >> speaking up. >> > > I should have commented on your other comments too... > > A table layout will generally not degrade the readability of the content > for blind people if the content organized within is such that it will > linearize. Similarly, this is true of nested tables. Browsers today are > so fast and good at rendering HTML that you would need some very serious > nesting to cause problems for the load time. I'm all for CSS, but I > definitely think there are some deficiencies in the browser support > currently. I've gone through all kinds of float hell for table-less > layouts for government website HTML, that's fine, but by no means is it > a walk in the park for all cases, especially where older browser > compatibility is necessary. BTW, Google's homepage still uses a table > layout. I'm sure there's a reason for it. > > Cheers, > Rob. > Oh, yes, I had forgotten about the compatibility... I made a nice, very simple index.php which blew away a client... but on IE it looks like, well... see my attachment.sheisse -- Hervé Kempf: "Pour sauver la planète, sortez du capitalisme." - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
Nathan Rixham wrote: > tedd wrote: >> At 2:06 PM -0400 5/15/09, Tom Worster wrote: >>> for one thing, a table is a great way of representing relations >>> (http://mathworld.wolfram.com/Relation.html). data tables are the >>> canonical >>> example but very often a form's structure is a relation, e.g. >>> between labels >>> and input fields, or between multiple input fields. >>> >>> some of the best designed and behaving web sites i know use tables >>> in ways >>> that a list apart would consider heathen. >> >> Heresy! :-) >> >> However, there are occasions such as in a calendar where not using a >> table would be more than difficult. I haven't received a decree yet >> as to IF that would be considered column data or not. > > I'm gonna differ on this one, when you simply float each calender item > to the left you're pretty much done, in many cases i find it easier > than tables. > >> I have, and continue to use, tables for forms. The main reason given >> for not using tables is because they are not considered accessible by >> those with disabilities. However, people with disabilities generally >> don't have any problems with forms if the forms are properly labeled. >> So, I think that's acceptable, but am sure heathen in css terms. >> >> But whenever/wherever I can, I try to avoid using tables -- >> especially in layouts. >> > > IMHO the whole css vs table based layouts is a bit pointless, fact is > that as web developers and designers we're struggling to fulfil > clients needs, designers aesthetic demands and end user functionality > using languages that really aren't cut out for the job. > > Sure we can manage to do and hack through things, but the second you > move away from a conventional style document with some hyper links > you've moved outside of the scope of html. So regardless of how we do > it, we're fitting square technologies in to round holes. > > In fact the most fitting use of (x)HTML and CSS I've ever seen are the > RFCs and Specifications on w3c.org - styled usable "documents" - not > what many term as a website, and certainly not a flashy zippy glossy > ecommerce store with a tonne of effects and even more functionality. > > It's a bit like creating a full glossy magazine in ms "paint" I guess. > > so ultimately i guess it's a case of 3 cheers and a round of applause > for anybody who's thus far managed to create a website that works and > that the client likes! > > regards :) > Hear! Hear! ;-) :-) -- Hervé Kempf: "Pour sauver la planète, sortez du capitalisme." - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: read the last line in a file?
Tom Worster wrote: imagine writing a script to run as a daemon reading data off the bottom of a log file that gets updated every few minutes and processing each new log line as they arrive. i could exec("tail $logfile", $lines, $status) every now and then. or poll the file mtime and run exec("tail $logfile", $lines, $status) when it changes. there will be some lag due to the polling interval. but it would be nice to not have to poll the file and somehow trigger the processing of the new line when the log file is written. but i'm not sure how to do that. any ideas? possibly the vaguest answer ever.. http://php.net/posix_mkfifo FIFOs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
PJ wrote: I know of no better place to ask. This may not be strictly a PHP issue, but... I am busting my hump trying to format rather large input pages with CSS and trying to avoid tables; but it looks to me like I am wasting my time as positioning with CSS seems an impossibly tortuous exercise. I've managed to do some pages with CSS, but I feel like I am shooting myself in the foot or somewhere... Perhaps I am too demanding. I know that with tables, the formatting is ridiculously fast. Any thoughts, observations or recommendations? If it is tabular data use tables. Otherwise use css. I have some rather complex forms done in CSS - for the most part, I use fieldset for for the different types of fields - and within a fieldset, just use a div with float: left; for individual stuff in the fieldset - with an occasional dummy div that is just clear: both; to force the next div down to the left. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
tedd wrote: At 2:06 PM -0400 5/15/09, Tom Worster wrote: for one thing, a table is a great way of representing relations (http://mathworld.wolfram.com/Relation.html). data tables are the canonical example but very often a form's structure is a relation, e.g. between labels and input fields, or between multiple input fields. some of the best designed and behaving web sites i know use tables in ways that a list apart would consider heathen. Heresy! :-) However, there are occasions such as in a calendar where not using a table would be more than difficult. Calendars are tabular data and thus a table is right way to do it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
Nathan Rixham wrote: tedd wrote: At 2:06 PM -0400 5/15/09, Tom Worster wrote: for one thing, a table is a great way of representing relations (http://mathworld.wolfram.com/Relation.html). data tables are the canonical example but very often a form's structure is a relation, e.g. between labels and input fields, or between multiple input fields. some of the best designed and behaving web sites i know use tables in ways that a list apart would consider heathen. Heresy! :-) However, there are occasions such as in a calendar where not using a table would be more than difficult. I haven't received a decree yet as to IF that would be considered column data or not. I'm gonna differ on this one, when you simply float each calender item to the left you're pretty much done, in many cases i find it easier than tables. But with tables, you can use th and td elements to describe the tabular data, and non visual browsers will know what to do with those tags to better describe the data in the table. Also, by using a table, you don't end up with funny display should the calendar be displayed in a small browser window. Yes, you'll end up with the dreaded horizontal scroll bar in a small window, but in the case of tabular data, that's what should happen. The only way to accomplish a div/css solution is with absolute position. Positioning tabular data with divs also goes completely to hell if the user turns of css. Tables still render the tabular data correctly with CSS turned off. That's why tabular data should be done with the table tag. Tables aren't themselves evil, using them for layout it. Example of the proper use of tables: http://www.shastaherps.org/SearchRecords?horder=3&page=1 The layout (and I confess, I'm no artistic design guru) is fairly basic div/css based layout. Haven't even tested in IE or Safari (fricken MS and Apple won't port their browsers to Linux) - there may be some CSS issues. The tabular data however (search results) is done the way tabular data should be done - via table. I could have done it with divs but table was the proper tag. All the "tables are evil" tripe needs to be noted that the tripe is within the scope of layout design, not the scope of tabular data. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sorting times (SOLVED)
Just a draft i thought should not go unnoticed on the list :-) just cleaning up. OK, How about a super efficient soln where each string is only converted once and a fast sorting algorithm is used: http://www.ihostnz.com Fred Allen - "California is a fine place to live - if you happen to be an orange." 2009/2/16 Shawn McKenzie > tedd wrote: > > At 9:31 PM -0600 2/14/09, Shawn McKenzie wrote: > >> > >> Yeah, hif I had known that you wanted a function where you loop through > >> your array twice, that would have done it. Bravo. > > > > Shawn: > > > > I don't see another way. You go through the array converting string to > > time (seconds), sort, and then convert back. You have to go through the > > array more than once. > > > > Cheers, > > > > tedd > > > The "other way", is the most likely ultra-fast solution I posted. > > -- > 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] CSS & tables
On Fri, May 15, 2009 at 03:12:06PM -0400, HallMarc Websites wrote: > Um... sorry to jump in as a late arrival yet there you go > > What limitations? You could provide a layered layout using CSS and png > graphic format. As for setting up columns check out float and clear and > you're all set. TABLE, TR, TD, TBODY, etc were never intended to be used in > the manner we see today. If you are blind and you hit a site with a mess of > nested tables then.. well you might leave because of the garbage you have to > listen to when the page loads. Speaking of which, correct me if I am wrong > and my info is out of date but TABLEs are loaded one at a time by browsers > and cause longer load times than necessary. Tables do take longer to load. The browser has to do a lot of math to determine how wide to make cells, etc. I don't know how this compares with CSS divs and such, speed wise. > > All in CSS is the way to go. CSS3 will make our lives easier and will > contain so many new features that it will be released in batches (modules) No doubt. But if history is any guide, it will be quite some time before browsers support a new standard. In fact, browsers typically fail to support existing standards fully. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS & tables
On Fri, May 15, 2009 at 01:25:42PM -0400, PJ wrote: > I know of no better place to ask. This may not be strictly a PHP issue, > but... > I am busting my hump trying to format rather large input pages with CSS > and trying to avoid tables; but it looks to me like I am wasting my time > as positioning with CSS seems an impossibly tortuous exercise. I've > managed to do some pages with CSS, but I feel like I am shooting myself > in the foot or somewhere... > Perhaps I am too demanding. I know that with tables, the formatting is > ridiculously fast. > Any thoughts, observations or recommendations? I think it's pretty telling that on a list of professionals who create websites constantly, the overwhelming concensus is that for forms, tables are the preferred solution. I liken this sort of discussion to the dichotomy between movie critics and people who actually go and see movies. The critics inevitably have all sorts of snobby things to say about the movies which are best attended. I'm not sure why anyone listens to any critic on any subject. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php