Results 1 to 4 of 4

Thread: Php coding question, help please! :)

  1. #1
    Join Date
    Aug 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Php coding question, help please! :)

    I used to have my own site and recently wanted to restart it up, but I have no files, so I'm relearning from scratch. I used to have it set up so all my CSS, background images etc were saved to 1 index.php file, and all the other pages referenced to loading the php file, and all i would do is copy and paste that code, and then put in the information for the page (basic html) ... The reason I used that method was if I wanted to quickly change the font color for instance on every page on my site I only had to modify the php file. Does anyone recall or know the code to load PHP that way? My explanation sucks but an example might be..

    Php file info: Includes CSS, Photos, Background colors, Font information

    Page 1 file info: (code to load the PHP info), Text, text, text, links, etc

    Any help is appreciated, Its frustrating me!

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Maybe you mean to use php's include().
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Aug 2008
    Location
    Estados Unidos
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default

    I think ranagana was right but a better solution for you might be to just use "external" CSS.
    Put something like this in between your <head> tags.
    <link href="../CSSFolder/Whatever.css" rel="stylesheet" type="text/css" />

    As long as you have good semantic markup you can work miracles with CSS.
    You could link as many pages as you wanted to the one "Whatever.css" style sheet.

    Check this site out.
    http://www.csszengarden.com/
    Every one of the layouts use the exact same markup.

    Hope that helps.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    <link href="../CSSFolder/Whatever.css" rel="stylesheet" type="text/css" />
    Except without the NET shorttag. See http://www.webdevout.net/articles/beware-of-xhtml.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. The Following User Says Thank You to Twey For This Useful Post:

    jeaux (08-17-2008)

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
  •