Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: PHP/Javascript read page contents with frames  (Read 2927 times)

0 Members and 1 Guest are viewing this topic.

ultimatum

    Topic Starter


    Intermediate
  • Thanked: 3
    PHP/Javascript read page contents with frames
    « on: May 19, 2010, 11:38:28 AM »
    Hey guys,

    I'm a little stuck here. Usually I use file_get_contents() function in PHP to read page's contents but there are some pages that have javascript and frames embedded. In result, the function only reads the code of the script but not the content inside the frame. I did some googling and found out that I would have to use javascript to read the contents but I only have basic knowledge of javascript.

    Has anyone done this before? May be someone has a function or could direct me to the right source where I could continue my search.

    Any help is appreciated and thanks in advance.

    - ultimatum
    Its not what you know, its what you can do that counts!

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: PHP/Javascript read page contents with frames
    « Reply #1 on: May 19, 2010, 12:44:19 PM »
    How does javascript get involved? that's client-side.

    What you want to do is use file_get_contents, and then parse out the <frame> tags, then you can use File_get_contents on the src attribute.
    I was trying to dereference Null Pointers before it was cool.

    kpac

    • Web moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: PHP/Javascript read page contents with frames
    « Reply #2 on: May 19, 2010, 02:36:29 PM »
    Look into cURL and preg_match.