SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: Including CSS

  1. #1
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Ohio
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Including CSS

    I'm editing a .inc file as part of a script. The header looks like this:

    function startpage($title="bitlog v0.6.5") {
    echo "<HTML>\n" ;
    echo "<HEAD><TITLE>$title</TITLE></HEAD>" ;
    echo "<BODY BGCOLOR=\"#FFFFFF\"> \n" ;

    echo "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\" align=\"center\" bgcolor=\"#CCCCCC\">" ;
    echo "<tr><td>" ;
    echo "<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\" align=\"center\" bgcolor=\"#EEEEEE\">" ;
    echo "<tr>" ;

    Everytme I try to squeeze "<LINK rel="stylesheet" href="../style.css" type="text/css">" in the <HEAD> I get errors about not being able to connect to the MySQL database. What would be the propper way to insert that?
    http://www.sianews.com: an independent, politically conservative news site

  2. #2
    SitePoint Member
    Join Date
    Jul 2001
    Location
    San Francisco Bay Area
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Try this

    Try this:

    echo "<LINK rel='stylesheet' href='../style.css' type='text/css'>";

    Webpenner

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Ohio
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That was my first thought and it dosen't work either.
    http://www.sianews.com: an independent, politically conservative news site

  4. #4
    SitePoint Enthusiast Ckeren's Avatar
    Join Date
    Jun 2001
    Location
    AU
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try use homesite.

    first open your html page where you want to include your css then find where is your css file if you havent got your css file, its very easy to create one using software called top-style it comes by default if you install homesite4.5.

    one you've created your css file just click on it and drag to your opened html page.

    it'll work 100%

  5. #5
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This works fine:
    PHP Code:
    <?
    function startpage($title="bitlog v0.6.5") { 
    echo 
    "<HTML>\n" 
    echo 
    "<HEAD><TITLE>$title</TITLE>\n" ;
    echo 
    "<LINK REL=\"stylesheet\" href=\"../styles.css\" type=\"text/css\">\n";
    echo 
    "</HEAD>\n";
    echo 
    "<BODY BGCOLOR=\"#FFFFFF\"> \n" 

    echo 
    "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\" align=\"center\" bgcolor=\"#CCCCCC\">" 
    echo 
    "<tr><td>" 
    echo 
    "<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\" align=\"center\" bgcolor=\"#EEEEEE\">" 
    echo 
    "<tr>" 
    }

    startpage(); ?>
    about the css file:
    example:
    /root/html
    => the code above is located in the folder html
    => styles.css is located in the root folder!
    if the href tag isn't right, your css file won't be attached of course

  6. #6
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Ohio
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That dosen't seem to work either. I get the following error:

    Parse error: parse error in /home/sites/site7/web/bitlog/bitlog.inc on line 23
    No Database Selected
    Warning: Supplied argument is not a valid MySQL result resource in /home/sites/site7/web/bitlog/index.php3 on line 21

    Fatal error: Call to undefined function: startpage() in /home/sites/site7/web/bitlog/index.php3 on line 27
    http://www.sianews.com: an independent, politically conservative news site

  7. #7
    Node mutilating coot timnz's Avatar
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well since there are not 23 lines of code in the sample you have provided us, it makes it hard for us to see the problem. Post the rest of the code, if there is any, so that we can help some more!

    Parse error: parse error in /home/sites/site7/web/bitlog/bitlog.inc on line 23
    No Database Selected
    Warning: Supplied argument is not a valid MySQL result resource in /home/sites/site7/web/bitlog/index.php3 on line 21

    Fatal error: Call to undefined function: startpage() in /home/sites/site7/web/bitlog/index.php3 on line 27
    Well the parse error means that the function is undefnied, so that is why the last error turns up, the No Database Selected means that there will be no results for your query, whereever it is, and so that is why you get the second error.

  8. #8
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Ohio
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The line 23 is correct, the script works fine before I try to add the CSS line in the header.
    http://www.sianews.com: an independent, politically conservative news site

  9. #9
    Node mutilating coot timnz's Avatar
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well then, something in that CSS stuff must be disturbing something else to do with the connection to the database, can't see anything else that might be wrong... I could be completely wrong though of course

  10. #10
    SitePoint Enthusiast cragthehack's Avatar
    Join Date
    Jul 2001
    Location
    Ft. Lauderdale, FL. USA
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well you could try using @import to bring in the style sheet. Keep in mind import is not supported in older browsers )netscape 4, IE3, etc...)

    here's an example:

    <style type="text/css">
    <!--
    @import url(../iglssw3c.css);
    -->
    </style>
    - crag
    net geek for non profits and political campaings


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
  •