close

Privacy guaranteed - Your email is not shared with anyone.

For the PHP guru's...

Discussion in 'Tech Talk' started by rsagona1, Nov 14, 2008.


  1. rsagona1

    rsagona1
    Expand Collapse
    Hello

    Joined:
    Jun 21, 2006
    2,394
    0
    Location:
    Somewhere in MD
    No question to post. Just to say, I vow to never, ever, ever mix HTML & PHP within the same document again.



    I learned (incorrectly) to echo out HTML within a php document after data processing. It got ugly. I wrote about 5k lines of code and I got angry and deleted it all.

    I started over, this time..actually using some common sense. I decided to use a template engine. If you're not familiar with this, google it, there are about 50 to choose from.

    It allows you to create HTML templates, store 'em away, and just use variables within the HTML document to link to the PHP data.

    i.e.:
    HTML:
    <html> <title> [php_processed_var]</title></html>
    In the PHP file, I just do all my data processing and declare the variables.

    PHP:
    <?

    $php_processed_var Hello World!
    ?>

    My code is ALOT cleaner. And I actually feel confident about showing it off.
     
  2. Fire_Medic

    Fire_Medic
    Expand Collapse
    Polymer Butcher
    CLM

    Joined:
    May 19, 2008
    8,097
    12
    Location:
    The Gunshine State
    post deleted my error.


    oh it was in general glocking lol, I thought I was going nuts. Glad you got your codes all figured out.:supergrin:
     

  3. rsagona1

    rsagona1
    Expand Collapse
    Hello

    Joined:
    Jun 21, 2006
    2,394
    0
    Location:
    Somewhere in MD
    :wow:Oops!