A beginner back end developer here.
I am basically trying to implement these instructions on my website forum so that my images aren't so huge for thumbnails slowing things down hugely: https://www.script-tutorials.com/how-to-resize-images-on-server-side/
I am on the second part.
Basically I have some code like this:
<a class="IndexImage" href="/forum/discussion/55/design-flaw-001-give-up"><img src="/forum/uploads/editor/dm/idnutwgmgaik.jpg" class="IndexImage"></a>
But I need the image src to change to
<img src="<?php loadImage('/forum/uploads/editor/dm/idnutwgmgaik.jpg', 50, 50) ?>"
I'm not sure if this would be possible with Javascript, or if at all? The logic I want to implement is basically iff .IndexImage img ---> then, prefix ~~<?php loadImage('
~~ to img source and append ~~', 50, 50) ?>
~~
It could be really easy, it could be impossible. Any feedback is appreciated. Thank you. I hope the question is very clear.
I have found this page explaining how you can change the src to something preset, https://stackoverflow.com/questions/11722400/programmatically-change-the-src-of-an-img-tag#= , but I am trying to dynamically modify the code.