Results 1 to 2 of 2

Thread: php and css

  1. #1
    Join Date
    Dec 2007
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default php and css

    Hi all,

    I'm relatively new to PHP and was wondering something. If I create a header, footer or nav bar that is a div, should the div be applied in the .php include file (i.e. - footer.php) or should the div be placed in the home page or template page and just bring in the text or images. So I guess I wondering if their is a proper way to apply php to css and visa versa. It seems like it would be easiest to layout the page / divs where I want them and then place include files with information inside of their respective div. I just didn't know what standard practices are...Sorry, but most of my sites have either been css/html or flash and even something as simple as a server side include is new to me.

  2. #2
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    I'm not sure that I understand, but usually as far as pulling in information goes, you would do something like this:

    PHP Code:
    <?php
    include('file.php');

    echo <<< END
        <html>
    <head>
        <title>
    $title</title>
    </head>
    <body>
        <div>
    $body</div>
    </body>
        </html>
    END;

    ?>
    But you can also do this:

    PHP Code:
    <?php
    $title 
    '<title>Hello</title>';
    $body '<div>Hello</div>';

    echo <<< END
        <html>
    <head>
        
    $title
    </head>
    <body>
        
    $body
    </body>
        </html>
    END;

    ?>
    It mostly depends on how you are creating the page. The best way, I would say, is to put as much as you can in the main template and as little as you can in the vars or other files.
    Last edited by Jas; 06-20-2008 at 06:25 PM.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •