Extract info in url problem

Discussion in 'PHP' started by Andy$$$, Dec 5, 2008.

  1. #1
    Hi guys/gals,

    I have been searching and searching but found nothing that I could use so I'm now asking in here.

    Can someone be so kind and tell me how a php script that takes an url and strip off some info and then take the rest and paste it into the meta keywords/description tags?

    For example http://www.somesite.com/?santa+klaus it should take santa & Klaus and add it to the meta tag when the page loads.

    Can this be done easily?

    Thanks in advanced for all suggestions!
     
    Andy$$$, Dec 5, 2008 IP
  2. Fracisc

    Fracisc Well-Known Member

    Messages:
    3,670
    Likes Received:
    10
    Best Answers:
    1
    Trophy Points:
    195
    #2
    Fracisc, Dec 6, 2008 IP
  3. SEOAnalytic.com

    SEOAnalytic.com Member

    Messages:
    106
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    <?php
    $url='http://test.tld/?first=First+Content&second=Second+Content&third=Third+Content';
    $_meta='';
    foreach($_GET as $key) $_meta.=$key;
    echo '<meta name="keywords" content="'.$_meta.'" />';
    ?>

    Try this and tell me how it works. This should be put where you want the meta keywords to be shown (in the head tags, of course).
     
    SEOAnalytic.com, Dec 6, 2008 IP