Hosting Test Site Domain:
CURL2 - Grab html content and write to text file

Windows only - Need to give the php folder write access first through the File Manager program in the HCC

The basic idea behind the CURL functions is that a CURL session is initialized using the curl_init function, 'curl_init()', then all options for the transfer are set via the curl_setopt function, 'curl_setopt()', then the session is executed with the curl_exec function, 'curl_exec()', and then the session is completed using the curl_close function, 'curl_close()'.

This test uses CURL to grab the content of an external HTTP URL ( and writes it to a local file (google_homepage.txt).

In addition to CURL functions this test also uses the PHP fopen function, 'fopen()' and fclose function, 'fclose()'. The fopen function opens the google_homepage.txt file (or creates it if it does not already exist) and makes it WRITE ONLY.

Complete the test by verifying the text file does not exist prior to the test's execution and does afterwards.

  • Click the 'View Text File' button below to verify text file does not exist (link will be broken).
  • Click 'Run Test' button.
  • Click 'Back' button to return to CRL 2 test.
  • Click the 'View Text File' button again to verify text file has been created (page looks like google).

Keep These Instructions Open