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
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");

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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