New to PHP and seeking direction

They have: 2 posts

Joined: Mar 2008

Hello all. This is my first post here and I'm enjoying reading posts from many of its knowledgeable members.

I am a web designer and I specialize in sites and graphics for drag race teams, engine shops, dynomometer facilities, and anything race or motorsports related. It's sort of a hobby-turned-business for me.

I'm well versed in HTML and don't run from CSS, but I'm new to PHP and realize I need to learn it and use to become a more effective designer.

The question is this:

I am building a site that has, like many others, a news page. Short of using plain old HTMLand simpling editing the content each time I want to add more news or updates, how would I go about doing this with PHP? In short, I'd like to keep the content in one file (e.g., XML, etc.)and have the "news" page pull its contents from that. I'm sure it is relatively simple, but I'm not really sure where to start looking.

Secondly, I would like to know the opinion on galleries. When making a photo gallery, at what point would using PHP and MySQL be better than just using a javasripted thumbnail table-based HTML gallery? Any tutorials to get me started on either topic would be greatly appreciated.

~Todd

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

The way I learned the basics of PHP and MySQL was reading this book (I highly recommend it). I know there are ton of tutorials on the web that could teach you everything in the book, but it's nice to get it all in one neat package.

If you don't want to go that in depth, you could look at some PHP scripts on HotScripts.com. Most of the scripts you get from there have a help page that can tell you how to install the script. There is a News Publishing category that you might want to look into.

My question is how did you learn HTML and CSS? If you learned it by looking at source code on other pages, looking at PHP source code would probably do you some good. If you read some books on the subject, get some PHP books (especially PHP and MySQL for Dynamic Web Sites). Did you take a formal class on HTML? If you did, go to a community college and see if they offer any PHP classes (though I would recommend taking a C class over PHP, but that's another story).

They have: 99 posts

Joined: Feb 2008

I've also just started learning php and was given these sites as a good starting point:

http://www.phpfreaks.com/forums/
http://devzone.zend.com/node/view/id/627

Hope these help and good luck

They have: 2 posts

Joined: Mar 2008

Thank you both. I learned HTML with books at first, about 6 or 7 years ago. Like anything, trying and trying again taught me even more. The same with CSS. I'm by far no expert with CSS, but I can do a lot with it and I know where to find help with what I don't yet know.

I have a PHP book I recently bought. It's easy reading, but I like to jump headfirst into things, so maybe this wasn't the right book for me.

I will check all of your suggestions out.
Thank you again,
Todd

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

I have gone through PHP & MySQL for Dummies and PHP5 for Dummies. I liked the clear directions and the author's sense of humor.

The best reference I use online is php.net. If you use Firefox, you can add php.net to your search box to the right of the address bar making it extremely easy to look up a function.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

todd@six4designs wrote: I am building a site that has, like many others, a news page. Short of using plain old HTMLand simpling editing the content each time I want to add more news or updates, how would I go about doing this with PHP? In short, I'd like to keep the content in one file (e.g., XML, etc.)and have the "news" page pull its contents from that. I'm sure it is relatively simple, but I'm not really sure where to start looking.

I did something like this as one of my first PHP projects. It might be a good opportunity to learn how to work with databases. What you could do is have a backend area where you input the news item, which is then written to a database. The front end simply pulls that information out and displays it.

I found W3 Schools' tutorials to be very helpful when I was learning.

todd@six4designs wrote:
Secondly, I would like to know the opinion on galleries. When making a photo gallery, at what point would using PHP and MySQL be better than just using a javasripted thumbnail table-based HTML gallery? Any tutorials to get me started on either topic would be greatly appreciated.

Anytime you want to store more than basic captions you should look into something that uses a database. However, there is no need to code something like this yourself (unless you just want the learning experience). Zenphoto is a nice open source package.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.