Re: [PHP] mixing HTML and PHP code
> You _actually_ print() or echo() everything you want to send to the > browser? Absolutely. We've replaced every HTML tag we use often with PHP functions. We separate content, style, layout, and logic so using 100% PHP is the best for us. > if you have ever worked in a fast paced production environment, where html > is changed sometimes 5 times a day, digging through hundreds of lines of: > > echo "" > > starts to make you insane. > > speaking as an html author, and a lover of php, _please_: > > > > it makes the code useable. IMHO even better is: input_text('hello', 20, $value); that's how that would appear on our site. We order the parameters logically and include a catch all final parameter that will add text to the HTML tag. > echo ""; > echo ""; > echo "$title"; > echo " href='resources/css/$css.css'>"; > echo " language='javascript'>"; > echo ""; > echo " vlink='#003366' topmargin='0' leftmargin='0' marginwidth='0' > marginheight='0'>"; > echo " bgcolor="#00">"; > echo ""; > echo " alt='' width='466' height='161' border='0'>"; > echo ""; > echo ""; > > it introduces a whole world of unnecessary complexity. > > to prove my point: > > get one of your friends that knows html but not PHP to look at the above, > then this: > > > > > > > > vlink="#003366" topmargin="0" leftmargin="0" marginwidth="0" > marginheight="0"> > bgcolor="#00"> > > alt="" width="466" height="161" border="0"> > > On our site that would more like: (comments) (include files) (page specific variables) html(); head($title); head_css('stylesheet.css'); head_script('script.js); x('head'); body($style) table(0, 0, 0, '100%', '', BLACK); tr('top'); td(); image('fire.jpg'); x('td'); x('tr'); x('table'); x('body'); x('html'); Well it would be a bit different because we have other logic and comments throughout, but you get the "jist" of it. BTW "image()" calls "img()" but adds the appropriate image directory to the path. img() is a function that creates the img HTML tag along with automatically finding out and adding the width and height parameters. I can't imagine going back to manually editing those every time I change the image dimensions. We have many people who contribute to this site. Some of them are content editors with no technical expertise. Simply saying "saty away from code in (these) tags" is not enough. 1.they don't have the HTML know how 2. I'm not risking even that much access. They don't go anywhere near an editor or FTP program, they do everything through interfaces we (the tech team) builds. . Jade Ohlhauser [website architect]... http://bandwidthplace.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mixing HTML and PHP code
> that may work for you, but it created a lot of overhead in your > applications, and anyone that doesn't know about you special "html api" will > be screwed... That I prefer to call it "investment" instead of overhead because it has given us a system we vastly prefer. > by all means use whatever techniques you like in-house, but that would be > completely useless to someone in the "outside world" That's fine. I just wanted to show people how we did it. I don't expect this to be useful in a all situations. In our experience PHP programmers who work with us don't have any problem figuring out how our system works. Without knowing anything about our system tell me you can't look at that code and "get it" Jade > > (comments) > > > > (include files) > > > > (page specific variables) > > > > html(); > > > > head($title); > > head_css('stylesheet.css'); > > head_script('script.js); > > x('head'); > > > > body($style) > > table(0, 0, 0, '100%', '', BLACK); > > tr('top'); td(); image('fire.jpg'); x('td'); x('tr'); > > x('table'); > > > > x('body'); > > x('html'); > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mixing HTML and PHP code
thanks I haven't thought about sharing the code, but it would be easy because our code is as abstract as possible. In fact there a few files which contain most of the "HTML replacements" that can be used on basically any site without modification. I'm too busy at the moment, I think I'll package my implementation for anyone who is interested. BTW in general I always name functions in this sort of style: category_specific_morespecific() meaning that ideally all my HTML replacement functions would be named something like html_tr() and html_head(). The reason I didn't do that was to make these functions we use all the time shorter to type and the code easier to read. Also a lot of my functions are flexible such as blockquote( $text = '' ) where if you specify some text it is enclosed in blockquote tags or if you don't it just opens the tag. ex, the following are the same: blockquote('print this text'); blockquote(); echo 'print this text'; x('blockquote'); Let me show you an example from our site, go to http://bandwidthplace.com/speedtest.html and run a test so you get to the results screen. (this example will only work for a few more days because we are debuting an all new speed test, I'm really excited about it) Anyway look at the explanations below the results box, those are printed by: $content = (function that grabs the text from our database); while(list($title, $text) = each($content)) { main_title1($title, BLUE2); blockquote($text); } that's it. . Jade Ohlhauser [website architect]... http://bandwidthplace.com - Original Message - From: "Kulkarni, Vikram" <[EMAIL PROTECTED]> To: "'Jade Ohlhauser'" <[EMAIL PROTECTED]> Sent: Friday, January 12, 2001 2:52 PM Subject: RE: [PHP] mixing HTML and PHP code > Hello Jade: > > I like your idea of using functions instead of HTML. It must simplify the > work tremendously. Is there any place you have published these functions? > I would love to take a look at them. I am a newbie PHP programmer and am > trying to learn from masters :-) > > Thanks, > > Vikram Kulkarni > > -Original Message- > From: Jade Ohlhauser [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 11, 2001 9:41 PM > To: PHP List > Subject: Re: [PHP] mixing HTML and PHP code > > > ** Please Note: This message came from the INTERNET. ** > > > You _actually_ print() or echo() everything you want to send to the > > browser? > > Absolutely. We've replaced every HTML tag we use often with PHP functions. > We separate content, style, layout, and logic so using 100% PHP is the best > for us. > > > if you have ever worked in a fast paced production environment, where html > > is changed sometimes 5 times a day, digging through hundreds of lines of: > > > > echo "" > > > > starts to make you insane. > > > > speaking as an html author, and a lover of php, _please_: > > > > > > > > it makes the code useable. > > IMHO even better is: > input_text('hello', 20, $value); > > that's how that would appear on our site. We order the parameters logically > and include a catch all final parameter that will add text to the HTML tag. > > > echo ""; > > echo ""; > > echo "$title"; > > echo " > href='resources/css/$css.css'>"; > > echo " > language='javascript'>"; > > echo ""; > > echo " alink='#CC' > > vlink='#003366' topmargin='0' leftmargin='0' marginwidth='0' > > marginheight='0'>"; > > echo " > bgcolor="#00">"; > > echo ""; > > echo " src='resources/images/binarycloud/tmpl/fire.jpg' > > alt='' width='466' height='161' border='0'>"; > > echo ""; > > echo ""; > > > > it introduces a whole world of unnecessary complexity. > > > > to prove my point: > > > > get one of your friends that knows html but not PHP to look at the above, > > then this: > > > > > > > > > > > > > > > > > vlink="#003366" topmargin="0" leftmargin="0" marginwidth="0" > > marginheight="0"> > > > bgcolor="#00"> > > > > > alt="" width="466" height="161" border="0"> > > > > > > On our site that would more like: &
Re: [PHP] Sending a mail in HTML format
1.that won't always display properly 2.that doesn't allow for inline images To do it properly use MIME. Richard Heyes has already done all the hard work for you: http://www.zend.com/codex.php?id=103&single=1 . Jade Ohlhauser [website architect]... http://bandwidthplace.com - Original Message - From: "Kristi Russell" <[EMAIL PROTECTED]> To: "Pascal Clerin" <[EMAIL PROTECTED]> Cc: "php" <[EMAIL PROTECTED]> Sent: Saturday, January 20, 2001 11:31 PM Subject: Re: [PHP] Sending a mail in HTML format > Nothing special, just add at the beginning of what you're trying to > send as HTML. Always worked for me? > > Kristi > > - Original Message - > From: "Pascal Clerin" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday, January 20, 2001 8:46 PM > Subject: [PHP] Sending a mail in HTML format > > > > Hello, > > > > I want to send a mail in HTML format with the mail() function. > > I have tried to send html stuff in the message parameter, but when I read > it > > in my hotmail account, I just see the html code and not what the html is > > supposed to show. > > I suppose that it is necessary to send some additional headers to specify > that > > the mail is in html format. > > Thanks for your help. > > > > Pascal > > > > > > Get free email and a permanent address at http://www.netaddress.com/?N=1 > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Pricing for PHP programming???
Who cares, they could never bust us. So lets decide on this list that we are going to set (or "fix" if you will) the price of PHP work at $100/per hour. Oh just a second, someone's at the door... ..... Jade Ohlhauser [website architect]... http://bandwidthplace.com - Original Message - From: "James Moore" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, February 01, 2001 2:10 PM Subject: RE: [PHP] Pricing for PHP programming??? > > > Isn't it illegal in the US to discuss > > rates in this manner? > > > > It's always been my understanding that > > The U.S. law specifically makes discussion > > of pricing between competitors (all or some) > > a federal offense. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]