I'm learning PHP for my college project and already have done lots of things with PHP. I'm fetching the images from database with PHP and want to enlarge them on click.
Asked
Active
Viewed 371 times
0
-
It would vary greatly depending on how you are storing it and clicking it. It is likely to be CSS/JS though that you'd do this with. – user3783243 Nov 20 '18 at 18:42
-
1You can only use `PHP` on `Server-Side`. To handle `user's` or `browser` event should use Javascript. – BadPiggie Nov 20 '18 at 18:43
-
This would be something that you would need to do through CSS/JS. PHP is a backend scripting language, and only outputs information to the browser. You will need to use CSS/JS to do anything dynamic on the client side once the page is loaded. __Edit:__ Additionally, "enlarge the image" can actually mean a lot of things in web development. Do you want the image to simply grow in size? Do you want it to pop up in a modal pop up or light box? Do you want it to open in a new window? Are you trying to display a thumbnail that gets resized or do you want the image to be stretched? etc. – RToyo Nov 20 '18 at 18:44
-
I'm trying to enlarge the image in modal popup with js. But it is only working on the first image fetched through while loop in php. – Rupinder Aulakh Nov 20 '18 at 18:49