Jump to content

5iFeR

New Members
  • Posts

    1
  • Joined

  • Last visited

5iFeR's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. <?php $htmlUrl = "https://faberlic.com/index.php?option=com_flform&idform=514"; // Fetch the HTML code $html = file_get_contents($htmlUrl); if (!$html) { die("Failed to fetch HTML code from $htmlUrl"); } // Extract the image information if (!preg_match('/<img data-type="lang" class="og-image" id="registration-img" style="max-width: 100%;\s*text-align: center; display: none;" src="(.*\.jpg\?v=.*?)" alt="Registration" \/>/', $html, $matches)) { die("Failed to extract image URL from HTML code"); } $imageUrl = $matches[1]; // Fetch the image and save it to a temporary file $tempImage = tempnam(sys_get_temp_dir(), "image"); $imageData = file_get_contents($imageUrl); if (!$imageData) { die("Failed to fetch image data from $imageUrl"); } file_put_contents($tempImage, $imageData); // Display the image if (!is_file($tempImage)) { die("Failed to create temporary image file"); } header("Content-Type: image/jpeg"); readfile($tempImage); // Delete the temporary file unlink($tempImage); ?> may have misdescribed preg_match. i am noob in php.
×
×
  • 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.