How to build sites with php?

Hello everyone!

I’m aware that my question is pretty vague considering there’s many ways of developing, It’s
more of a question of what approach to take to make a professional site, where you
can still understand the code after you’ve finished writing it. I’ve tried MVC,
procedural, lots of different things, but I find that PHP is not nearly as clean and enjoyable
to program as java. It’s more fun to program php in some ways, but the code conventions are
very bad compared to java.

I guess what I’m trying to say is how can I start constructing good looking elegent sites in
php without my code looking like frankenstein’s monster. If people could also give me
advice on what techniques they prefer that would also be very helpful!

Check out Zend Framework. http://framework.zend.com/

It doesn’t matter how you program in PHP… it’s still PHP. It will always look the same. I always liked PHP’s syntax, but I can’t remember much of it as I have not done any in more than 4 years. I used to be a great PHP programmer but I hated general web development (eg using HTML, CSS, layouts, etc). Also, PHP-GTK+ reminds me of Java now that I think of it.

I’m going to read more about zend, it looks like it has good convertions
and a good api.

Thanks for the help!

Don’t forget good html; well here are some good links:

Building a clean site with PHP is like trying to shoot yourself in the head without making a mess.

Not really. I used to write very advanced websites with PHP with extreme ease. I did all the coding in Notepad, surprisingly. I wrote a complete forum software like phpBB and sold it for $250 (wasn’t quite advanced as phpBB, however). It was a sure nice chunk of change. I also did a lot of backend programming with PHP, such as a CMS (Content Management System). And I obviously couldn’t live with having PHP without MySQL.

Totally Agree.

Php is a pain in the …

I have to use it in my job and most of the time i wish i had some other scriptlanguage for the projects i have to do.
When you want to do clear code in php, make sure you have a good design first. Reuse as many code as you can or you will end up with spagetthi code on mass.

If you also have some client side scripting I would suggest to use jquery, since it allows for “unobtrusive” scripting, which means you can declare your javascript separately like with css without any direkt js-call in the rendered html.

Edit: site is down :confused: try http://en.wikipedia.org/wiki/JQuery for the time being