At 04:20 -0800 11/16/08, weepy wrote: > Consider the approach: > > 1) Take a standard HTML page > 2) Modify it to include some simple PHP (e.g. <%= $myvar %>) > 3) Rename the file to .php > 4) Upload page.
I agree with some of the comments made by others about maintenance, security, etc. However, I use this approach quite frequently when I simply want to add some dynamic behavior to a web page, shorten some URLS for ease of editing, etc. For example, I run a local social event here in the SF Bay Area: Beer and Scripting SIG http://www.cfcl.com/rdm/bass which occasionally changes venues and continuously (well, once a month :-) has a new date. To reduce my editing hassle and keep errors under control, I used a bit of PHP. The page brings in the venue description from a separate file and calculates the date of the upcoming event (it's always on the 4th Wednesday) on the fly: <? $name = $_SERVER[SCRIPT_NAME]; $intro = (ereg('indexX', $name)) ? '__introX' : '__intro'; include $intro; dt(dse(4, 3), '8:00 pm'); # 4th Wednesday # Default to Pasquale's... $loc = array( '200812' => '_Wild_Pepper', # Finesse Christmas. '200911' => '_Wild_Pepper', # Finesse Thanksgiving. '200912' => '_Wild_Pepper', # Finesse Christmas. ); $inc = $loc[ $GLOBALS[yyyymm] ]; $inc = ($inc == '') ? '_Pasquales' : $inc; include $inc; ?> So, although I wouldn't suggest using PHP for a database-backed web site, it's just the thing for adding some dynamic content to a single web page. I'd be delighted to have an equivalent way to use (say) erubis for this sort of thing. If this meant that I could easily migrate to a full Merb stack, so much the better! -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume [EMAIL PROTECTED] http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "merb" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/merb?hl=en -~----------~----~----~----~------~----~------~--~---
