SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    Bored One boredboi's Avatar
    Join Date
    Jul 2000
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi all, regarding the get_meta_tags function in php,

    1. Can you get meta-tags from "http://blahblah.com" instead of from pages in your own site?

    2. Can you just put "http://www.blahblah.com" or do you have to specify the entire path "http://www.blahblah.com/blah.html"

    3. Does the "/" at the end of a path affect it?

    I've checked the php.net manual but it doesnt say, so thank you for your help...

  2. #2
    Bored One boredboi's Avatar
    Join Date
    Jul 2000
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no one knows?

    i've tried to test out it out but i keep getting mixed results, and i don't know whats affecting what...

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What exactly is your error, I do it all the time on remote sites just like this

    $array = get_meta_tags("http://www.somedomain.com");

    print $array["keywords"];
    print $array["description"];


    Those are the only two things it returns, and I imagine the function would fail if at least one of those was not present on the page you are trying to grab them from.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    Bored One boredboi's Avatar
    Join Date
    Jul 2000
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've tried this:

    <html>
    <head> </head>
    <body>
    <?php
    $metatags = get_meta_tags("http://www.phpbuilder.com/", 1);
    echo $metatags[keywords];
    ?>
    </body>
    </html>

    but all i get is this: (when i view source)

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
    <BODY></BODY></HTML>

    I've even tried without the "/" behind, without the ",1"
    even without "http://", but i keep getting the same results and a blank page. Can someone please help me?

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What version of php are you running, I used your exact code and it gave me the keywords from the phpbuilder site? Again what error are you getting?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  6. #6
    Bored One boredboi's Avatar
    Join Date
    Jul 2000
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks so much for helping...
    i'm using Omni Httpd - with php 4.0.1pl2

    my error is that i get a blank page...
    Could it be because i'm using Omni?


  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just sent you a script at your email listed in your profile. It will tell you whether the function is available although I would think that you would get a function does not exist error if it didn't. You are able to run other php scripts right??
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  8. #8
    Bored One boredboi's Avatar
    Join Date
    Jul 2000
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    argh...

    i uploaded it to my website, and it works perfectly.
    i guess Omni httpd is screwy.. Are you using omni or apache?

    thanks anyway.

  9. #9
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use Apache for Windows, although I can't imagine that the web server would be the problem? I know this may seem like a stupid question(so please don't take offense), but you are connected to the internet when you try and run this function right?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  10. #10
    Bored One boredboi's Avatar
    Join Date
    Jul 2000
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes.............................
    it might not be the server, it might be a setting somewhere... I'll just go get apache and try it out.


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
  •