0

I simply want to load above page's complete contents and display using php. I tried below method but it did not work.

$url = "http://www.officialcerts.com/exams.asp?examcode=101";

$curl = curl_init($url);

curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);

$output = curl_exec($curl);

curl_close($curl);

$DOM = new DOMDocument;

$DOM->loadHTML( $output);

How do I walk the Document that loadHTML produced?

John Hascall
  • 9,176
  • 6
  • 48
  • 72
  • 2
    `did not work` is not a proper problem description. As for loading full page; you can run into numerous resource path problems if relative url's are used in source – charlietfl Jan 12 '16 at 15:46
  • Where do you set the value of `$items`? ... – John Hascall Jan 14 '16 at 15:52
  • See http://stackoverflow.com/questions/2909849/loop-over-domdocument for examples of how to walk the DOM Document Tree that `loadHTML` built -- well, maybe built, you don't check the return value of `loadHTML` to see if it worked or not.... – John Hascall Jan 14 '16 at 15:58

1 Answers1

-1

If you like to display the page as is, Use a frame to load your page, this is the simplest way ever:

<frame src="URL">

Frame tag

Yazid Erman
  • 1,166
  • 1
  • 13
  • 24
  • i think you did not see what i am trying to achieve. using html frame tag is not a way to do it. – S Nazia Jan 12 '16 at 15:47
  • [`` is deprecated](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/frame)... are you sure you didn't mean ` – charlietfl Jan 12 '16 at 15:49
  • i don't want to use – S Nazia Jan 12 '16 at 15:53