Best way to teach yourself how to program?
th: I would try to learn the client-side (the within-the-browser stuff) markup/styling/programming before jumping into the server-side programming.  Understanding how browsers handle the HTML (markup), CSS (styling), and JavaScript (programming) takes time.  I think it's much easier to learn and apply a server-side language (PHP, Perl, etc.) after you have a good understanding of the content the server-side language will be throwing at the browser to handle.