FIRST PART 1. USE THE SAME LINK AS THE SEARCH ENGINE SENDS WEBSITE VISITORS TO.
THIS TIME THE WEBPAGE LINK: https://goodeveningexpress.com/scanphotos/index.php NOW LETS LOAD THE LINK AND LOOK FOR 4 PHOTO LINK NAMES ON THE SCANNED PAGE. WE HAVE NOW AUTOMATICALLY LOADED 4 PHOTOS/IMAGES FROM THE SCANNED PAGE AND THEIR NAMES ARE:IMAGENAME ONE: SECRET-SERVICE-OUTSIDE-THE-WHITE-HOUSE.jpg IMAGENAME TWO: {84A7D6DC-E287-4B33-BD27-DADFD5833058}.bmp IMAGENAME THREE: 1f5630cd12920480.jpg IMAGENAME FOUR: 151006-F-OC707-001-3270845083.jpg https://goodeveningexpress.com/scanphotosWE TAKE AWAY THE LAST FILENAME FROM THE URL/LINK. Then we add a new end trailing slash: https://goodeveningexpress.com/scanphotos/PART NEXT ARE VALIDATE THE 4 IMAGE LINKs TO SEE THAT WE HAVE THE RIGHT URL LINKs AND FILENAMEs...check... IMAGENAME ONE: https://goodeveningexpress.com/scanphotos/SECRET-SERVICE-OUTSIDE-THE-WHITE-HOUSE.jpg IMAGENAME TWO: https://goodeveningexpress.com/scanphotos/{84A7D6DC-E287-4B33-BD27-DADFD5833058}.bmp IMAGENAME THREE: https://goodeveningexpress.com/scanphotos/1f5630cd12920480.jpg IMAGENAME FOUR: https://goodeveningexpress.com/scanphotos/151006-F-OC707-001-3270845083.jpg 23612570070942151833917770ALL 4 PHOTOS DOWNLOADED TO SSD-NVME DISKS. IT'S ALL DONE WHILE YOU LOAD THIS PAGE.
BELOW ARE THE SOURCE CODE AND DOWNLOADED IMAGES.YOU CAN TEST A NEWLY DOWNLOADED IMAGE - CLICK HERE
YOU CAN TEST A NEWLY DOWNLOADED IMAGE - CLICK HERE
YOU CAN TEST A NEWLY DOWNLOADED IMAGE - CLICK HERE
YOU CAN TEST A NEWLY DOWNLOADED IMAGE - CLICK HERE
// LOAD THE LINK TO GET IMAGES FROM
$url = "https://goodeveningexpress.com/scanphotos/index.php";
$htmlString = file_get_contents("$url");
// CREATE A NEW DOMDOCUMENT OBJECT.
$htmlDom = new DOMDocument;
// LOAD THE HTML DATA $STRING INTO THE PHP DOMDOCUMENT OBJECT..
@$htmlDom->loadHTML($htmlString);
//EXTRAXT ALL IMAGE TAGS FROM THE HTML DATA TO DATASTRING $imageTags.
$imageTags = $htmlDom->getElementsByTagName('img');
// FORCE A NEW COPY THE $imageTags TO A NEW $DATASTRING NAME CALLED $imageTags2 FOR REAL EASYNESS.
$imageTags2 = $imageTags ;
// USE THE NEW $imageTags2 NAME TO RETRIEVE IMAGE SOURCE DATA.
// GET THE NEW IMAGE ITEM DATA AS A NEW $DATASTRING CALLED $PHOTOSTART1
// AND GET 4 IMAGES FROM THE SCANNED PAGE.
$imageTags2 = $htmlDom->getElementsByTagName('img');
$PHOTOSTART1 = $imageTags2->item(1)->getAttribute('src');
$imageTags2 = $htmlDom->getElementsByTagName('img');
$PHOTOSTART2 = $imageTags2->item(2)->getAttribute('src
$imageTags4 = $htmlDom->getElementsByTagName('img');
$PHOTOSTART3 = $imageTags4->item(3)->getAttribute('src');
$imageTags5 = $htmlDom->getElementsByTagName('img');
$PHOTOSTART4 = $imageTags5->item(4)->getAttribute('src');
// WE NOW HAVE 4 PHOTOS FROM THE SCANNED PAGE
echo "WE HAVE NOW AUTOMATICALLY LOADED 4 PHOTOS/IMAGES FROM THE SCANNED PAGE AND THEIR NAMES ARE: ";
echo "IMAGENAME ONE: $PHOTOSTART1 ";
echo "IMAGENAME TWO: $PHOTOSTART2 ";
echo "IMAGENAME THREE: $PHOTOSTART3 ";
echo "IMAGENAME FOUR: $PHOTOSTART4 ";
echo $new = substr_replace($url,'',strrpos($url, '/'));
echo "WE TAKE AWAY THE LAST FILENAME FROM THE URL/LINK. Then we add a new end trailing slash: ";
echo " $new/" ;
echo " ";
echo " ";
echo " ";
echo "PART NEXT ARE VALIDATE THE 4 IMAGE LINKs TO SEE THAT WE HAVE THE RIGHT URL LINKs AND FILENAMEs...check... ";
$external_link = "$new/$PHOTOSTART1";
if (@GetImageSize($external_link)) {
$READYIMAGE1 = "$new/$PHOTOSTART1";
$READYIMAGE2 = "$new/$PHOTOSTART2";
$READYIMAGE3 = "$new/$PHOTOSTART3";
$READYIMAGE4 = "$new/$PHOTOSTART4";
}
echo "IMAGENAME ONE: $READYIMAGE1 ";
echo "IMAGENAME TWO: $READYIMAGE2 ";
echo "IMAGENAME THREE: $READYIMAGE3 ";
echo "IMAGENAME FOUR: $READYIMAGE4 ";
// ======================= Function to write image into file
$RSSPAGE1 = file_get_contents($READYIMAGE1);
echo file_put_contents("$PHOTOSTART1","$RSSPAGE1");
$RSSPAGE2 = file_get_contents($READYIMAGE2);
echo file_put_contents("$PHOTOSTART2","$RSSPAGE2");
$RSSPAGE3 = file_get_contents($READYIMAGE3);
echo file_put_contents("$PHOTOSTART3","$RSSPAGE3");
$RSSPAGE4 = file_get_contents($READYIMAGE4);
echo file_put_contents("$PHOTOSTART4","$RSSPAGE4");