my coding tips are:
a) indent your code properly, comment it well. you need to be able to understand your own code. now and in 3 years time.
b) use sensible variable, function and class names: they should say what they do. $page_number is better than $pn.
c) RTFM. PHP has so many functions, it's silly. you will often find yourself writing a function which already exists. PHP's own functions are less buggy and MUCH faster.
d) factor out your code. if 20 pages do the same thing, try to write the code only once and include it in each file. seperate presentation from logic.
e) plan, plan, plan. the more deeply you understand what it is you want to do and how you want to do it before you start, the less chance that you will realize you did something really daft at the beginning and you are basically going to have to rewrite everything.
f) KISS. keep it simple, stupid. the simpler the code, the less likely it is to go wrong and the easier it is to debug when it does.
when i build something, first i try to understand exactly what i need to do, and decide how i will do it. i use a basic structure for most stuff: header.inc & footer.inc take care of most of the presentation. they are also full of PHP code, but it is related to presentation. presentation should not be confused with HTML. i always try to keep the number of templates and stylesheets to an absolute minimum: when your client changes their mind (and they will), you won't have so much work to do. my static pages tend to have 5 or so lines of PHP code and HTML content in the middle. for the more dynamic pages, especially editing etc. i prefer to bang all of the functionality into a class in inc/ and have little more than a switch statement in the calling page. if you keep the roles of your pages well-defined and minimize copying code, you will find debugging much easier. i also have one .inc script which initializes the whole site, including all other necessary files, reading cookies, starting sessions etc., which i call on every page to cut down on the require_once() calls.
i like classes (probably cos i mostly use python or ruby). the difference between functions and classes is simple:
a function, say string_foo_bar($string, $foo), becomes $string->foo_bar( $foo ).
functions do things to data you give them. classes do things to themselves. the difference is mostly conceptual. but, the huge advantage of classes is inheritance.
you can write a class "vehicle" with methods "start", "stop", "forwards" etc., then base classes "car", "bus" and "plane" on "vehicle" and you get all the "vehicle" methods for free.
PHP is very C-like. it is not really an OO language, so classes are much less important. compare:
PHP: foreach( $x as $y) { ... }
Ruby: $x.each { ... }
or:
PHP: for ( $x=0; $x < 5; $x++ ) { ... }
Ruby: 5.times { ... }
so, i would forget about classes till you start doing relatively complex stuff. stick to functions: they are faster.