Help me out with my sloppy HTML/PHP -
this might sound silly question how make code seem...neater?
echo "<h3><font face='helvetica'><font size='4'><b><font color='b80000'>$title</font></font></font></b> <font color='a0a0a0'>$category </font><font color='a0a0a0'><a href='profile.php?id=$userid'>$user</a></font> <font face='helvetica'><font size='3'><br> $desc</font></font><br> <h3><font color='101010'> $city,$state $zip <font color='a0a0a0'>$date</font> </font></h3>"; ?> there's nothing wrong code looks sloppy - wondering if me out making neat , tidy
- don't use
<font>- move rules css, can style<h3>element. also! not computers have helvetica, may want change"helvetica", arial;design stays inline intent. - stay away using
<h3>twice - put second h3<p>or similar, , use css style that. $city,$state $zip dirty - concatenate string spaces in php, echo string.- instead of using echo output php, use
echoinside of html elements - make more readable. - use
htmlspecialchars()on every piece of data comes out of database before echo page. prevents invalid html and xss vulnerabilities.
that should tighten up!
Comments
Post a Comment