Jump to content

[SOLVED] Change all "img src" to "https" after "require"


webent

Recommended Posts

Was wondering if anyone could point me in the right direction on how I would go about changing the calling location of images to their secure location after the page in which contains the images is called from a "require"?

 

Here is my require...

<? require $url . "/includes/header.inc"; ?>

 

Now is there a way to parse that include file before it is output, to change any "<img src="http://" to "<img src="https://"?

Ok, it worked, thanks MasterACE14...

$completeFilePath = $preurl . "/includes/header.inc";        
$handle = file_get_contents($completeFilePath);
$search = array("<img src=\"");
$replace = array("<img src=\"" . $otherurl . "/");
$fields = str_replace($search,$replace,$handle);
echo $fields;

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.