Instructions
1. Right click on the PHP file you want to use to connect to external website. Click on "Open with" and select your favorite PHP editor.2. Open the website you want to extract data. The following command connects to the external website using cURL: $ url = curl_init ("http://misitio.com/"); Replace "misitio.com" with the URL to which you want to connect.
3. Opens a file to copy the results. If you want to copy the results to a local file, add the following code to the PHP function: $ copy = fopen ("contenido_descargado.txt", "w"); Replaces the TXT file with the file name you want to use. Using this function, the entire text of "misitio.com" and the HTML file will be downloaded "contenido_descargado.txt" on your server.
4. Close the file and the connection to the external server. You must close the connection to the file server and the connection to free memory on the server. Add the following code at the end of the PHP function: curl_close ($ ur); fclose ($ copy);