diff --git a/curl.igalerie.php b/curl.igalerie.php new file mode 100755 index 0000000..37702c5 --- /dev/null +++ b/curl.igalerie.php @@ -0,0 +1,110 @@ +loadHTML($return); +$inputs = $dom->getElementsByTagName('input'); +foreach ($inputs as $input) { + $cle = $input->getAttribute('name'); + $valeur = ""; + if($cle=="anticsrf"){ + $valeur = $input->getAttribute('value'); + } + if(!$valeur=="") break; +} + +$postfields = array(); + +$postfields['publish_images'] = 'on'; +$postfields['anticsrf'] = "$valeur"; +$postfields['action'] = 'scan'; + +$postfields = http_build_query($postfields); + +curl_setopt($curl, CURLOPT_URL, $site.$lien3); +curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); +curl_setopt($curl, CURLOPT_COOKIEFILE, realpath($path_cookie)); +curl_setopt($curl, CURLOPT_COOKIEJAR, realpath($path_cookie)); +curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); +curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); +curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); +curl_setopt($curl, CURLOPT_HEADER, true); +curl_setopt($curl, CURLOPT_COOKIESESSION, true); +curl_setopt($curl, CURLOPT_POST, true); +curl_setopt($curl, CURLOPT_POSTFIELDS, $postfields); + +$return = curl_exec($curl); +$headers = curl_getinfo($curl); + +if (!$headers['http_code'] == '200'){ + echo "Erreur Step 3"; + exit(1); +} + +@$dom->loadHTML($return); +$div = $dom->getElementById('ftp_report'); +$ps = $div->getElementsByTagName('p'); + +foreach ($ps as $p => $value) { + echo "$value->nodeValue\n"; +} + +curl_close($curl); + +exit(0); diff --git a/curl.igalerie.quennec.fr.php b/curl.igalerie.quennec.fr.php deleted file mode 100755 index 37702c5..0000000 --- a/curl.igalerie.quennec.fr.php +++ /dev/null @@ -1,110 +0,0 @@ -loadHTML($return); -$inputs = $dom->getElementsByTagName('input'); -foreach ($inputs as $input) { - $cle = $input->getAttribute('name'); - $valeur = ""; - if($cle=="anticsrf"){ - $valeur = $input->getAttribute('value'); - } - if(!$valeur=="") break; -} - -$postfields = array(); - -$postfields['publish_images'] = 'on'; -$postfields['anticsrf'] = "$valeur"; -$postfields['action'] = 'scan'; - -$postfields = http_build_query($postfields); - -curl_setopt($curl, CURLOPT_URL, $site.$lien3); -curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); -curl_setopt($curl, CURLOPT_COOKIEFILE, realpath($path_cookie)); -curl_setopt($curl, CURLOPT_COOKIEJAR, realpath($path_cookie)); -curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); -curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); -curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); -curl_setopt($curl, CURLOPT_HEADER, true); -curl_setopt($curl, CURLOPT_COOKIESESSION, true); -curl_setopt($curl, CURLOPT_POST, true); -curl_setopt($curl, CURLOPT_POSTFIELDS, $postfields); - -$return = curl_exec($curl); -$headers = curl_getinfo($curl); - -if (!$headers['http_code'] == '200'){ - echo "Erreur Step 3"; - exit(1); -} - -@$dom->loadHTML($return); -$div = $dom->getElementById('ftp_report'); -$ps = $div->getElementsByTagName('p'); - -foreach ($ps as $p => $value) { - echo "$value->nodeValue\n"; -} - -curl_close($curl); - -exit(0);