PDA

View Full Version : Best book to learn PHP for vB? How did YOU learn?


Razasharp
07-10-2005, 08:14 PM
Hi All

I was just wondering if any of you guys have any recommendations for the best way to go about learning PHP. Particularly if the aim is to better understand vB in order to create hacks for it.

Would have to be for a complete novice as I know next to nothing of PHP!

I'd also, be interested in any other methods any of you used - online tutorials etc? If so which?

Any help appreciated.

Thanks in advance

akanevsky
07-10-2005, 08:26 PM
www.php.net ... That's how I learned :) What I like about php is that they have an official site with a normal manual :)

Which can be found here:
http://www.php.net/manual/en/index.php

Razasharp
07-10-2005, 08:40 PM
Thanks Dark Visor...

Do you have any particular advice? For eg did you go full on read the manual? Just an idea of the path you took would be great just to give us an idea :)

Adrian Schneider
07-10-2005, 08:43 PM
I suggest something like SAMS PHP in 24 hours to figure out the basics, then browse through functions on php.net and other PHP files you see and learn from there.

akanevsky
07-10-2005, 08:49 PM
No, of course you don't read the full manual. You cannot memorize it all at once, and nobody can...

What I did is I downloaded the *.chm version of the manual (can be found here http://www.php.net/docs.php). Then I went through the first 3 sections of it (up to features). Then I read the next two sections (up to 5th), reading only what I might need in the nearest future.

Then, I started writing my own scripts. While writing those scripts, I kept referring (and I still keep referring) to sections IV, V and VI of the manual, for the particular functions or tricks that I need to use. Like if I need to find out a certain file management function, I go to "File Management" subsection of section VI... That's how it goes - I refer to certain parts of the manual when there is a need to use them.

I suggest something like SAMS PHP in 24 hours to figure out the basics, then browse through functions on php.net and other PHP files you see and learn from there.

Well, IMHO it is too basic... There is nothing better than an official manual if there is one, because an official manual usually also tells you about any special things that you have to pay attention to ;)

Adrian Schneider
07-10-2005, 09:09 PM
For not knowing any PHP or other programming languages PHP is pretty complex, but if you are coming from another language, the manual is all you need. Everyone learns at different rates.

Razasharp
07-10-2005, 09:21 PM
Thanks both.

Thats a good point TheSpecialist. Dark Visor - how much programming did you know before you started learning php?

akanevsky
07-10-2005, 09:25 PM
Practically none... Maybe a bit of an extremely invalid HTML 4.01 and some javascript that worked only in internet exlorer ;) When I started making dynamic pages was when I also learned valid XHTML and more javascript.

With all due respect to TheSpecialist, I would not agree with him. In my opinion (which may be wrong as well), PHP is one of the easiest languages there are. To have any trouble with it, you must either come from a completely different language such as C++ or not read a manual before trying to write your scripts.

Razasharp
07-10-2005, 09:36 PM
Ok last question @ Dark Visor... when did you first start learning php? (this will give us a very vague idea of ho wlong it might take to get to your level!)

Guest190829
07-10-2005, 09:39 PM
I suggest PHP and MySQL Web Development. It's a huge book that's cut into 3 main parts. PHP/ Mysql/ Creating Major Web Applications with PHP & mySQL. Although, it covers PHP 5, it's still a great book. Even when your done reading it, it serves as a great reference too.

amykhar
07-10-2005, 09:46 PM
One of the best ways to learn a new programming language is to actually have something you need or want to do in the language, and then use online resources to help you figure out how to do it.

Learn the basics with the HelloWorld type programs and then, it's time to do things that matter to you.

If you start small and work your way up, you will learn a lot and feel like you really got something done.

For example, figure out something tiny that you would like to change about your forum. Maybe you want to recognize the 5 most recent members on your site instead of just one. Then, you start reading the index.php code until you can figure out the gist of what's going on and where the code is that relates to the newest member.

Then, it's just a matter of finding code somewhere that does sort of what you want to do, and making it do exactly what you want it to do. ;)

Amy

Razasharp
07-10-2005, 10:00 PM
Thanks Danny and Amy.

Just out of interest how did you guys learn? and what would you have done differently in hindsight? Sorry to be a real nosey parker!!

P.s Amy, that sounds like a great idea for some hands on which Im sure I will do at some stage :)

akanevsky
07-10-2005, 10:02 PM
Ok last question @ Dark Visor... when did you first start learning php? (this will give us a very vague idea of ho wlong it might take to get to your level!)

To my level? I am not that great. I still don't know many aspects of PHP. Though, it is not needed to know many aspects in order to be able to make great scripts ;) Here is the answer to your question: It took me a year to get to where I am right now. Do not let that misguide you. As TheSpecialist said, everybody learns at their own pace. Feel free to ask more questions, it's ok ;)

I suggest PHP and MySQL Web Development. It's a huge book that's cut into 3 main parts. PHP/ Mysql/ Creating Major Web Applications with PHP & mySQL. Although, it covers PHP 5, it's still a great book. Even when your done reading it, it serves as a great reference too.
I think I've heard the title. Is that an O'Reilly book? If yes, then it is a great book, as well as all other O'Reilly books are ;) If there is no official manual to something, the first place I go to is an O'Reilly store.

One of the best ways to learn a new programming language is to actually have something you need or want to do in the language, and then use online resources to help you figure out how to do it.
That is true. Another good way is to take a fine-coded script like vBulletin and to try to understand how certain things from within it work. This is, by the way, one of the good ways to learn a language, or to find out a good algorithm that does something you are struggling with.

P.S. My first PHP script was a PHP engine for a non-php site, lol.

Then, it's just a matter of finding code somewhere that does sort of what you want to do, and making it do exactly what you want it to do.
Yep. However, I would recommend using only a code that you understand and agree with explicitly. Otherwise, if you use random codes from various pieces of software, your script might become buggy and eventually cease to work. Leave alone the possible security violations it might pose. Therefore, if you are going to use other people's code, I recommend starting with simple code imports that you can easily understand, and then gradually going up to larger and harder codes.

amykhar
07-10-2005, 10:12 PM
I learned to program in BASIC in Junior high in the early 1980's. I picked up HTML, C, C++ and Java when I was in college, Perl when I installed Infopop's UBB and PHP when I installed Vbulletin.

Until I first installed VBulletin, I didn't know anything about SQL either. I learned by reading people's hacks and then by making minor changes of my own.

Razasharp
07-10-2005, 10:27 PM
Thanks Anthony for answering - I am sure I will have more questions along the way (just can't think of any more right now!) hope you won't mind if I PM u at some point :classic:

Amy - sounds like you got a good start to it all! We did bits n bobs in school and i messed about with basic when I was a kid, but cant remb any of it now!

I hope I get the time to sit down and learn php - I've wanted to do it for a while but so many things have cropped up (decorating the house at present!).

Thank you all for taking the time to reply, I forgot how helpful you guys here at vb.org are!! :up:

akanevsky
07-10-2005, 10:31 PM
Thanks Anthony for answering - I am sure I will have more questions along the way (just can't think of any more right now!) hope you won't mind if I PM u at some point

No problem.

Amy - sounds like you got a good start to it all! We did bits n bobs in school and i messed about with basic when I was a kid, but cant remb any of it now!

What's "bits n bobs"? By the way, I learned BASIC in junior high too... but it is kind of a pointless language, IMO. It would be better if they taught PHP or C++ in school :)

Christine
07-10-2005, 10:39 PM
I suggest PHP and MySQL Web Development. I second this recommendation. :)

I never used php or MySQL before playing around with vBulletin in 2001. Coming out of the M$-SQL DBA world, I wasn't a programmer at all, just my dB skills other than the odd VB/VBa classes.

Thanks to all I have learned from working with vBulletin, a few years ago I rewrote my website in php and turned over 1,200 pages into 9 dynamic php files. SO much easier to keep updated now! I just reoptimized the code this spring and went for XHTML validation with full CSS layout. Something I never would have tackled if I had 1,200 pages to fuss with, so php afforded me the opportunity to learn even newer and greater stuff. :)

I did the same way Amy suggested -- finding things I wanted to change and figuring out how to change them. Downloading various hacks (some installed, some not) to see how others were working with the code, and asking for help when I get stuck.

I am no where near a coder, more of a muck-arounder who can follow directions well. If I can do this, pretty much anyone can.

:)

Guest190829
07-10-2005, 10:42 PM
I only officially started learning PHP this christmas, and I feel like I have the more than just the basics understood. I'm a very quick learner, so what I did was bought the book (PHP and MySql Web Development) and read it very quickly. This allowed me to grasp the concepts of php; now I use the book as reference. So, when I need to do something with php I go to the book, and find out how to do it in the book. If it isn't clear enough, I go to the PHP manual and get the information there. The best way I learned PHP was through the mistakes I made.

And I only knew HTML/CSS/ and basic Javascript before I started learning.

akanevsky
07-10-2005, 10:46 PM
I second this recommendation.

Hey hey, it's actually third :) But who cares.

Thanks to all I have learned from working with vBulletin, a few years ago I rewrote my website in php and turned over 1,200 pages into 9 dynamic php files. SO much easier to keep updated now! I just reoptimized the code this spring and went for XHTML validation with full CSS layout. Something I never would have tackled if I had 1,200 pages to fuss with, so php afforded me the opportunity to learn even newer and greater stuff.
Ha! 1200 pages? That's too little. I call that laziness :)
I know a website that has over 5000 (approx.) badly formed HTML pages, and neverthless the administrators of that site have never remade it into PHP. xD

Christine
07-10-2005, 10:55 PM
Okay -- thirded then. :D

The website that owns one of the the forums I run is much the same. ~3,500 pages, most with a '90s flavor. Just the thought of putting them into a database gives the site owner hives, so he recruits people in chunks to update them. :)

Razasharp
07-10-2005, 11:03 PM
What's "bits n bobs"?

It's a slang term that just means 'a bit here and a bit there', nothing consistant or continuous :)

Thank you all for replying - you have given me some great motivation!!

My first project (I hope!) will be to create a yellow-pages-type 'directory' somehow integrated with vB :paranoid: (well my first real project anyway!). Wish me luck!! (and please look out for my 'help' posts coming to a computer screen near you soon!)

Ok... Update.... Just ordered: PHP and MySQL Web Development, 3rd Edition
Luke Welling, Laura Thomson, from amazon.co.uk ?25.55 :bunny:

akanevsky
07-11-2005, 12:03 AM
Ok... Update.... Just ordered: PHP and MySQL Web Development, 3rd Edition
Heh, you hurried with that, because php.net's manual + google might have been more than enough. But oh well ;) additional manuals have never hurt anybody.

Razasharp
07-11-2005, 12:13 AM
Yes you are right DV - I'm one of those people that need to commit myself to something (normally finiancially!!) in order to stick with it for a while. I will probabaly make a lot of use of your suggestion too (particularly when I need to refer to something thats not covered in the book) so your advice was no way in vain, and I appreciate your thoughts and posts in this thread very much :)

I also like books because I can read it where the computer screen cant easily go - ie the loo! lol

akanevsky
07-11-2005, 12:19 AM
I also like books because I can read it where the computer screen cant easily go - ie the loo! lol

Make use of ICE Book Read Professional (http://www.ice-graphics.com/ICEReader/DownloadE.html).