NameSilo

Simple question - Adding img resize tags within PHP

Spaceship Spaceship
Watch

JsteRmX

Established Member
Impact
2
simple question - adding HTML img resize tags within PHP echo

Hey, I have this line of code

PHP:
echo "<td><img src =\"" . $rowB['user_image']."\"></td>";

and i want to add width and height dimensions to it. I tried by making it:

PHP:
echo "<td><img src =\"" width="100" height="60" . $rowB['user_image']."\"></td>";

but this gives me an error on my page saying:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' on line 51

Line 51 is the line of code I posted above.

Please help. Thanks!
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
PHP:
echo '<td><img src="'.$rowB['user_image'].'" width="100" height="60"></td>';
You added the width and height in the middle of your src.. not to mention a bunch of other crazy stuff.
 
0
•••
thanks, that worked perfectly.
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back