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> Quote Link to comment Share on other sites More sharing options...
WebStyles Posted February 27, 2014 Share Posted February 27, 2014 (edited) 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 Edited February 27, 2014 by WebStyles Quote Link to comment Share on other sites More sharing options...
jchan94 Posted February 27, 2014 Author Share Posted February 27, 2014 (edited) 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. Edited February 27, 2014 by jchan94 Quote Link to comment 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. Quote Link to comment 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> Quote Link to comment Share on other sites More sharing options...
WebStyles Posted February 27, 2014 Share Posted February 27, 2014 (edited) 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) Edited February 27, 2014 by WebStyles Quote Link to comment 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.