PDA

View Full Version : Learning Basic PHP


f-stop
02-24-2005, 10:02 PM
Is there an easy way to get just a basic handle on PHP? Any good tutorials or books that you know of? I have started using a few new scripts on my site and it seems that they are all based on PHP anymore and it always gives me fits when I have to install and configure them. Plus, I would like to be able to customize the look of the pages after installation and I just don't "get" PHP well enough to do this.

Any suggestions?

Silmaril8n
02-24-2005, 10:42 PM
The first and only book I ever bought was PHP & MySQL for Web Development (http://www.amazon.com/exec/obidos/tg/detail/-/067232525X/qid=1109299248/sr=8-4/ref=sr_8_xs_ap_i4_xgl14/002-7068209-0526407?v=glance&s=books&n=507846).

I have the first edition of it and it was great at showing me real working examples from very basic principles to advanced login scripts and database queries. I would recommend it to anyone.

Viper007Bond
02-24-2005, 11:56 PM
I learned by dissecting script to figure out how they worked and by asking how to do stuff in #php IRC channels.

Silmaril8n
02-25-2005, 12:45 AM
I tried to learn C++ via IRC but had a hard time finding anyone knowledgable with MFC. Now I know better and wouldn't touch them, but it was frustrating.

f-stop
02-25-2005, 08:32 AM
The first and only book I ever bought was PHP & MySQL for Web Development (http://www.amazon.com/exec/obidos/tg/detail/-/067232525X/qid=1109299248/sr=8-4/ref=sr_8_xs_ap_i4_xgl14/002-7068209-0526407?v=glance&s=books&n=507846).

I have the first edition of it and it was great at showing me real working examples from very basic principles to advanced login scripts and database queries. I would recommend it to anyone.

I'll see if I can find this book and take a look. What would you guys say is the main purpose for PHP? Where is it best used? What would I want to do with it other than maybe edit some templates on a PHP script that I already have?

Silmaril8n
02-25-2005, 01:55 PM
I'll see if I can find this book and take a look. What would you guys say is the main purpose for PHP? Where is it best used? What would I want to do with it other than maybe edit some templates on a PHP script that I already have?
Well, the great thing about PHP, and any other language for that matter, is that you can do just about anything you set your mind to.

You can go from a simple idea to allow customers to fillout anonline form for bids that complete error checking and data validation... to more complex projects like managing customer accounts and such.

I've mentioned it before but I started working with PHP when I was building my employers website a few years ago. I built a very simple trouble ticket system that allowed all our field techs to access the current problems and such. Since then I've expanded it to simple accounting system where we have stores log their sales activity, on top of revamping the trouble ticket system several times. PHP is way too cool IMO.

f-stop
02-25-2005, 03:01 PM
So how hard do you think it will take for a non code type person like my self to pick up on it and actually be able to do something with it? Is it pretty easy to get the hang of or should I just plan on a big learning curve?

Silmaril8n
02-25-2005, 03:12 PM
So how hard do you think it will take for a non code type person like my self to pick up on it and actually be able to do something with it? Is it pretty easy to get the hang of or should I just plan on a big learning curve?
It depends a lot on what kind of background you are coming from. Do you have any programming experience at all? Do you write your own HTML? Both of these skills willlcome in very handy because you are essentially blending a program with HTML output. I have learned some C++ and a few other languages over the years (not proficiently -- just the basics) and just having the simple knowledge of basic program logic and syntax helped a lot!

Mr. Popularity
02-25-2005, 03:24 PM
I'll see if I can find this book and take a look. What would you guys say is the main purpose for PHP? Where is it best used? What would I want to do with it other than maybe edit some templates on a PHP script that I already have?
PHP stands for Hypertext Preprocessor. It outputs markup based on the program at hand. If/Else, database queries, math, you name it!

Silmaril8n
02-25-2005, 03:27 PM
PHP stands for Hypertext Preprocessor. It outputs markup based on the program at hand. If/Else, database queries, math, you name it!
Gotta love that recursive acronym. Maybe a little known fact but when PHP was first created it stood for "Personal Home Page."

f-stop
02-25-2005, 05:30 PM
It depends a lot on what kind of background you are coming from. Do you have any programming experience at all? Do you write your own HTML? Both of these skills willlcome in very handy because you are essentially blending a program with HTML output. I have learned some C++ and a few other languages over the years (not proficiently -- just the basics) and just having the simple knowledge of basic program logic and syntax helped a lot!

I have a pretty good background with HTML, but no real programming experience. I have managed to edit enough PHP to get a script configured on my site a few times and I do kind of see how it works. I'll let you know how it goes. Actually, you guys will probably be the ones who get to help me figure it out, I hope.

Viper007Bond
02-25-2005, 08:06 PM
It's all logical. You basically gotta be able to think in terms of if/elseif/else kinda stuff.

f-stop
02-25-2005, 08:44 PM
It's all logical. You basically gotta be able to think in terms of if/elseif/else kinda stuff.

I can do logic if I need to, so maybe it won't be so bad. However, if I do the logic thing for to long I get a brain cramp.

Silmaril8n
02-25-2005, 09:14 PM
Well, between a basic book, online tutorials, and forums like this, you should find it fairly easy to pickup and roll with.

ColemanHamilton
02-27-2005, 12:18 AM
<?php

function start($name) {
print"<tr>".
"<td>There is a easy way to start coding $name</td>".
"</tr>".
" Called PHP/MySQL 5 BIBLE".
" Best book ever made ;)";
}

start(Coleman);
?>


Coding is easy to me, been doing it for years, I code games. You'll probally be amazed, i've been learning by the book I just told you, in the early days I learned it by http://www.php.net

All you need is time, and you can do great things.

Cheers!
-Coleman

Silmaril8n
02-27-2005, 02:29 AM
Not the greatest HTML though... ;)

Viper007Bond
02-27-2005, 05:25 PM
And not really the best PHP either. :p

(This is my 2000th post BTW! :D)

f-stop
02-27-2005, 06:05 PM
(This is my 2000th post BTW! :D)

Nobody likes a show off. :p How many entries do you think you have in the contest at this point. I should have a whopping "1". WhooHoo!

Silmaril8n
02-27-2005, 06:56 PM
And not really the best PHP either. :p

(This is my 2000th post BTW! :D)
For all intents and purposes, it's a good example though. I hope he doesn't take it the wrong way. I just have a very dry sense of humor.

Congrats on 2k!

iDxMan
02-27-2005, 11:58 PM
For all intents and purposes, it's a good example though. I hope he doesn't take it the wrong way. I just have a very dry sense of humor.

Congrats on 2k!

..and if we really want to be picky the variable passed to the start function needs to be quoted. (single quote, but that's just me)

Although at this point any example is a start.

-r

Viper007Bond
02-28-2005, 02:07 AM
Nobody likes a show off. :p How many entries do you think you have in the contest at this point. I should have a whopping "1". WhooHoo!
I started with ~1200 posts, so around 30 entries. :)

GCharb
04-29-2005, 09:04 AM
My first php book was Teah yourself php in 24 hours by sam publishing, it is for beginners, tons of examples and cheap, you can even get tons of used ones on amazon!

Gilles

Delta_Boy
04-29-2005, 09:25 PM
If you all want to increase your post count? You may fill up my post with answers here (http://forums.hostrocket.com/showthread.php?t=17143). :D

I too have a few books on php. They are "php for the world wide web" and "php and mysql". Both are published by Visual Quick Guide. I have found them to be quit helpful.

BTW. Somebody had mentioned #irc channels for php. Where do I find some good ones?

GCharb
04-29-2005, 10:58 PM
#irc on irc.freenode.net is not bad!

Heu, who wants to increases his or her post count? ;)

Gilles

f-stop
04-30-2005, 11:17 AM
Well, back when this thread was originally started there was a contest on and the more posts you had the better your chances of winning. There isn't a contest like that at the moment, at least that I know of. So, the posts here now are just for helping others and friendly banter. Anyway, I would help with the problem with the curly brace error, but since I started THIS thread to get more info on learning PHP, I'm not likely to be any help.

There are some very helpful and knowledgable members here who I bet would be glad to help.

GCharb
04-30-2005, 11:24 AM
Heu, not #irc but rather #php, on irc.freenode.net

Gilles