Need Help With Php Snippet

Discussion in 'PHP' started by clasione, Aug 31, 2006.

  1. #1
    <?php
    require_once '/home/mysite/www/news/files.php';
    CarpConfAdd('descriptiontags','|img');
    CarpCacheShow('http://news.google.com/news?hl=en&ned=us&ie=UTF-8&q={WHAT CAN I PUT HERE TO GRAB META TITLE}&output=rss');
    ?>

    :confused:
     
    clasione, Aug 31, 2006 IP
  2. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #2
    wmtips, Sep 1, 2006 IP
  3. Cryogenius

    Cryogenius Peon

    Messages:
    1,280
    Likes Received:
    118
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you mean the title of the web page, you need to set it as a variable. You then display that variable as the title and in your snippet. You may also need to convert spaces to plusses. For example:

    
    <?php
        $title = 'Principles of Web Design';
    ?>
    <HEAD>
        <TITLE><?php echo $title;?></TITLE>
    </HEAD>
    
    <BODY>
        <H1><?php echo $title;?></H1>
    <?php
        $keywords = str_replace(' ', '+', $title);
        require_once '/home/mysite/www/news/files.php';
        CarpConfAdd('descriptiontags','|img');
        CarpCacheShow('http://news.google.com/news?hl=en&ned=us&ie=UTF-8&q=$keywords&output=rss');
    ?> 
    </BODY>
    
    HTML:
    Cryo.
     
    Cryogenius, Sep 1, 2006 IP