Jump to content

Updating picture & text on several pages


raydona

Recommended Posts

Hi,

  I have a 125 X 156 jpeg image with some text underneath in the right column of my home page and the same image and text in the right column of 47 other pages. When I update the image and text in my home page I don't want to do the same 47 other times. So I have placed the image and text in a separate file. I am guessing I  have to insert preg_replace() function at the places where I want the updates to be made. My knowledge of PHP is not that great. So can anyone give me the exact function and parameters I have to use to replace the image and text. I would be very grateful.

Link to comment
https://forums.phpfreaks.com/topic/253221-updating-picture-text-on-several-pages/
Share on other sites

You only need to include the page where you have the image in all 47 files.

And when it needs to be updated you change it only in the image.php file

 

e.g. image.php

 

<?php

echo "<img src='image.jpg' width='125' height='156' />";

?>

 

e.g. index.php, blabla.php

 

<?php

// wherever the right column is
include("image.php");

?>

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.