1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Quick PHP <Head> question

Discussion in 'PHP' started by misohoni, Aug 26, 2004.

  1. #1
    This META code works, but wondering how I can implement a Stylesheet inside it. My stylesheet reference would be:
    SEMrush
    <style type="text/css" media="all">@import "../style.css";</style>

    The code currently is:

    <?php
      function MetaSimple()
      {
        return Meta("Shop - Buy Books Online : Feng Shui Chinese",
                    "Buy Chinese Feng Shui Books online.");  
      }
      
      function Meta($Title, $Description)
      {
        $Result  = "<HEAD>\n";
        $Result .= "<TITLE>$Title</TITLE>\n";
        $Result .= "<META name=\"description\" content=\"$Description\">\n";
    
    //    $Result .= "<META http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">";
        $Result .= "</HEAD>\n";
        return $Result;    
      }
      
      function DocType()
      {
        return "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
      }
    
    ?>
    PHP:
     
    misohoni, Aug 26, 2004 IP
    SEMrush
  2. xml

    xml Peon

    Messages:
    254
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    function Meta($Title, $Description)
      {
        $Result  = "<HEAD>\n";
        $Result .= "<TITLE>$Title</TITLE>\n";
        $Result .= "<META name=\"description\" content=\"$Description\">\n";
        $Result .= "<style type=\"text/css\" media=\"all\">@import \"../style.css\";</style>\n";
    
    //    $Result .= "<META http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">";
        $Result .= "</HEAD>\n";
        return $Result;    
      }
    PHP:


    Does that not work?
     
    xml, Aug 26, 2004 IP