jchan94 Posted February 27, 2014 Share Posted February 27, 2014 So I am working on a php based website for an organization (learning php as well) and I'm having this very basic problem where I can't resize the images to the sizes I want them to be in PHP. Here is where the image gets pointed to: <td rowspan="12"><img src="/images/profiles/<?php echo $user_id ?>.jpg" width:"333" height="500" /></td> <td>Name: </td> <td><?php echo $user_name;?> </td> I tried the simple img width & height, but the images called upon for each user is still not resizing properly. What am I doing wrong?? <td rowspan="12"><img width:"333" height="500" src="/images/profiles/<?php echo $user_id ?>.jpg" width:"333" height="500" /></td> <td>Name: </td> <td><?php echo $user_name;?> </td> Link to comment https://forums.phpfreaks.com/topic/286569-resizing-images/ Share on other sites More sharing options...
WebStyles Posted February 27, 2014 Share Posted February 27, 2014 there are several ways to do it. What you're trying is not really resizing, you're just displaying it smaller (the image will look the size you want, but the actual image file stays the same size) with html: (you had a typo in yours) <img src="/images/profiles/<?php echo $user_id; ?>.jpg" width="333" height="500" /> with inline css: <img src="/images/profiles/<?php echo $user_id; ?>.jpg" style="width:333px;height:500px;" /> or you can look into PHP's GD Library, that will resize the actual file. Hope this helps Link to comment https://forums.phpfreaks.com/topic/286569-resizing-images/#findComment-1470871 Share on other sites More sharing options...
jchan94 Posted February 27, 2014 Author Share Posted February 27, 2014 there are several ways to do it. What you're trying is not really resizing, you're just displaying it smaller (the image will look the size you want, but the actual image file stays the same size) with html: (you had a typo in yours) <img src="/images/profiles/<?php echo $user_id; ?>.jpg" width="333" height="500" /> with inline css: <img src="/images/profiles/<?php echo $user_id; ?>.jpg" style="width:333px;height:500px;" /> or you can look into PHP's GD Library, that will resize the actual file. Hope this helps I thought it was that simple but the dimensions of the jpeg being called is still not being resized on the page. Link to comment https://forums.phpfreaks.com/topic/286569-resizing-images/#findComment-1470874 Share on other sites More sharing options...
WebStyles Posted February 27, 2014 Share Posted February 27, 2014 Please post the modified version of your code. Link to comment https://forums.phpfreaks.com/topic/286569-resizing-images/#findComment-1470876 Share on other sites More sharing options...
jchan94 Posted February 27, 2014 Author Share Posted February 27, 2014 Please post the modified version of your code. <td rowspan="12"><img width:"333" height="500" src="/images/profiles/<?php echo $user_id; ?>.jpg" width="333" height="500" /></td> <td>Name: </td> <td><?php echo $user_name;?> </td> Link to comment https://forums.phpfreaks.com/topic/286569-resizing-images/#findComment-1470880 Share on other sites More sharing options...
WebStyles Posted February 27, 2014 Share Posted February 27, 2014 Now go back, compare the code I gave you with your code, and you'll see why I asked you to post the code again (you're not paying attention to what you're doing) Link to comment https://forums.phpfreaks.com/topic/286569-resizing-images/#findComment-1470896 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.