Link pull via PHP

Discussion in 'PHP' started by Scorpiono, Jan 21, 2007.

  1. #1
    Site A, has a script, via $_GET they have the URL of Site B, and then Site A, displays all the links in Site B, in a list, "Related websites: <br>"

    It's basically a link grab, via php, any reference or ideas or pre-made scripts I can see to understand.

    Help would be really apprecited. I'll rate you well on DP!
     
    Scorpiono, Jan 21, 2007 IP
  2. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Are you looking for function suggestions?

    Maybe file_get_contents() or fsockopen() or even perhaps curl.
     
    noppid, Jan 21, 2007 IP
  3. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Can you clarify the question? I think fopen() also works in this case on top of what noppid said.
     
    projectshifter, Jan 21, 2007 IP
  4. Scorpiono

    Scorpiono Well-Known Member

    Messages:
    1,330
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    120
    #4
    Not sure if it worked, could you make a php code that simply gets all the link in another page?

    Site A has an input, I insert the URL of SITE B.
    Site A displays all the links in SITE B.

    Example:

    If SITE B has "Yahoo.com" "http://www.msn.com" "http://digitalpoint.net" in their archor tags, site A will display them in a list, as "related websites"
     
    Scorpiono, Jan 22, 2007 IP
  5. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can make a code that grabs all of the links, but it's going to take a little bit of work. Getting the html will be the easy part, then you have to search for and find http:// and go until the end of the quotes or have a couple extra catches in there, it's a bit of a pain.
     
    projectshifter, Jan 22, 2007 IP
  6. KC TAN

    KC TAN Well-Known Member

    Messages:
    4,792
    Likes Received:
    353
    Best Answers:
    0
    Trophy Points:
    155
    #6
    KC TAN, Jan 22, 2007 IP
    JEET likes this.
  7. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #7
    KC TAN, That's perfect! :)
    Green for you... :D
    Bye
     
    JEET, Jan 22, 2007 IP
    KC TAN likes this.