raydona Posted December 15, 2011 Share Posted December 15, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/253221-updating-picture-text-on-several-pages/ Share on other sites More sharing options...
kney Posted December 15, 2011 Share Posted December 15, 2011 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"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/253221-updating-picture-text-on-several-pages/#findComment-1298101 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.