So my plan is instead of adding a style to each picture or making different images with different sizes, I made this script:
/*FILENAME image.php*/
if(isset($_GET['size'])){
$image['size'] = $_GET['size'];
$size = explode('x', $image['size']);
$image['width'] = $size[0];
$image['height'] = $size[1];
} else {
$image['size'] = null;
}
echo "<img src='images/".$image['name'].".jpeg' style='width:".$image['width']."; height:".$image['height'].";'>";
But it doesn't work, In one of my scripts, I have this:
echo '<img id="img_01" src="image.php?name='.$row2['name'].'&size=150x160" data-zoom-image="image.php?name='.$row2['name'].'&size=150x160"/>';
And the browser echo's just a missing image. How could I make my script work? I know there must be a way because I remember doing something like this with an open source.