NameSilo

Simple question - Adding img resize tags within PHP

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
thanks, that worked perfectly.
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back