Jump to content

xZenjix

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

xZenjix's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Im sorry, Im confused. I dont have an array of text stored in a variable. I do have two variables though. Im new so im trying to piece it together but Im confused on where I put my $OldHTML and $NewHTML variables.
  2. I saw that - the problem I am confused with implementation.
  3. Ok, so I have an INI file... OLD HTML= NEW HTML= I need to write the contents $oldhtml to "OLD HTML=" and the contents of $newhtml to "NEW HTML=" To store the contents of an ini file to a variable, I just used $config = parse_ini_file("config.ini",1); $email = $config['Email']; $host = $config['Host']; Cant I just write to the file by selecting ['Old HTML'] and ['NEW HTML'], in a fashion similar to the above code?
  4. <html> <head> <title>Testing</title> </head> <body> <?php $config = parse_ini_file("config.ini",1); $email = $config['Email']; $host = $config['Host']; print_r ($host); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $host); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $contents = curl_exec ($ch); $fp = fopen($host.'.txt','w+'); $fw = fwrite($fp, $contents); curl_close ($ch); fclose($fp); ?> </body> </html> Ok, I am having a problem here. I have an automation script I am trying to make, but I hit a road block. I need to open up multiple URL's from using an array of URL's stored in my config.ini file. It looks like this: Config.ini Host[] = www.websitea.com Host[] = www.websiteb.com Host[] = www.websitec.com Host[] = www.websited.com I want to use curl_setopt to open up each one of the urls stored in $host. If I use... print_r ($host); ...I get this output: Array ( [0] => www.websitea.com [1] => www.websiteb.com [2] => www.websitec.com [3] => www.websited.com ) Now, I need to take those websites in the array and open each one of them using curl_unit. I tried doing this... curl_setopt($ch, CURLOPT_URL, $host); Then $fp = fopen($host.'.txt','w+'); But I knew that wouldnt work. Basically, I need to open up all of the pages listed in the .ini file and save the HTML Content of those pages to their own text file, that's named after the URL. I figured I could open an array of URLS from my INI and write each one to their own text file. Example: websitea.com.txt (HTML Content from www.websitea.com) websiteb.com.txt (HTML Content from www.websiteb.com) websitec.com.txt (HTML Content from www.websitec.com) websited.com.txt (HTML Content from www.websited.com)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.