Jump to content

I'm teaching myself PHP. Where to start...


MietzeCat

Recommended Posts

Alright, I'll try not to make this a lengthy post. I tend to ramble.

 

The dealio is, I've been hesitantly attempting to learn php for about two years, but now I've forced myself to learn it, as I've set up a parking page for a forum [phpBB] that I intend on modding to the point of non-recognition. I'm hoping to get a beta version of the forums out by the end of this year [2009]...but feel free to tell me if you don't think that's possible. Anyway, I got a PHP reference-like book that taught me almost nothing.  :-\ Oh well. However, I have already started a forum with members and a work journal awaiting my release of this site. So, I've decided to teach myself.

 

I am actually pretty familiar with the structure of php...i.e. how to switch from html to php, vice versa. I'm also lightly familiar with the call/answer and line aspects of php. I'm pretty good at HTML (I've been using it for over 5 years.) but I am absolutely terrible at CSS.  :-[ The thing is, whenever I've tried to teach myself a subject, I've found that books are very bad at telling you what you'll be using a lot, and what you'll be using sort of/sometimes. I'm here to ask you experienced developers  ;) for your take on it. Basically, I'd like to know about you!

 

How long have you been using PHP? How did you learn it? What do you normally use it for? What are some key aspects of PHP you think need to be learned really well (Be specific, I'm a total newbie at this.)? Why? What are some things that I shouldn't stress over if I don't really understand? Finally, what other languages/features would be beneficial for me to learn before embarking on this adventure? Any other tips/references/suggestions?

 

I will use your 'answers' to gauge where my reading needs to focus, and what subjects I need to practice before. Thank you guys so much! You don't understand how much it helps for me to see your answers.

 

If you'd like to tell me I'm insane and will never learn it in time...go ahead. People call me crazy all the time!  ;D

 

Sample Reply:

I've been using HTML for about 5 to 6 years, and I taught myself how to use it. I gained my general knowledge of HTML by first studying the language and then using what I learned in conjunction with Dreamweaver to obtain the rest of what I'd need to build a website successfully, for what I normally use it. I think the basics need to be learned really well for HTML. You're going to use the title, background, header, text, and images tags most (at least for web design) but there are a wealth of other features you can use to create your perfect website. There's not really much you won't use...but you can do without the *insert tag name here* tags. HTML works with a variety of other languages. I suggest you learn how to use CSS with your website, and PHP and Flash can make it more interactive, but a knowledge of Javascript, Ruby on Rails, etc. can ornament and make your website easy to use. I suggest you start out by using http://www.funkychickens.com to learn the absolute basics and then use *insert reference book here*.

Link to comment
Share on other sites

How long have you been using PHP? 4 yrs

 

How did you learn it? Self taught through php.net

 

What do you normally use it for? EVERYTHING lol, cookies.. images.. sessions.. making files.. reading directories..

 

What are some key aspects of PHP you think need to be learned really well? Arrays (lol)

 

Why? Because you'll always use them, in every single script you'll ever write, there will be an array, unless its a hello world app lol.

 

What are some things that I shouldn't stress over if I don't really understand? cookies, you'd more than likely want to go with sessions, and php gd isn't that big of a deal if youdon't learn it..

 

what other languages/features would be beneficial for me to learn before embarking on this adventure? my first ever scripting language was mSL (mIRC Scripting Language), very similar, but can confuse someone from that to php, just go str8 for php, its easy enough

 

Any other tips/references/suggestions? http://php.net/ | http://w3schools.com | http://phpfreaks.com/

 

Link to comment
Share on other sites

I wrote this post a few days ago that you might want to look at.

 

In short, it's not so much learning PHP's syntax (that's easy), but rather learning methodology and acquiring the right mindset for a programmer.

 

@RusselReal: That's exactly what I'm looking for...thank you!!! Have you used W3Schools? Does the certification process work? ie. Is it worth anything? A scam?

 

@DanielO:  :o That was so not what I was looking for, and yet exactly what I needed. When you say 'real math', is Calculus the right idea? I'm going through it right now.  ::) Do believe it is possible to teach it to yourself? Is there any resource that can help you avoid security discrepancies and flawed code before you make those errors?  (I've seen boards go down under hackers...live boards...and the damage is so bad that the board has to be reset completely.)

How about a resource to aid in code organization?

In addition, if practicing hard enough, do you believe one would be able to create a secure-enough, heavily modded phpbb board?

 

I'm kind of question-obsessed.  :P

Link to comment
Share on other sites

You don't necessarily need a particular kind of math if you just want to do general programming, but the ability to think abstractly about a problem will help you. Maybe see this post. Maybe "advanced math" was the wrong term. You at least want to be sure you're confident with math and that you know something else besides elementary math. If you want to do something like computer science you would need advanced math though.

 

You can probably jump right into it without knowing anything. I did, but it really took a long time being at least decent this way (decent by the standards I hold now - when I was younger and just started out I probably pretty quickly found myself good, but I wasn't). You can get something done very quickly in PHP without very much knowledge, and I suppose that is what makes it so difficult. The problem is just that if you don't know anything, you will have no idea of what is good and what is bad to do. If you don't know any common attack vectors people will use, you will have no idea of how to protect yourself from them, or even that you're vulnerable to them in the first place (see this tutorial for a primer on security).

 

Don't be afraid to use the manual. It's quite well written, and it often contains notes about best practice.

Link to comment
Share on other sites

How I started with php, if I remember corectly, I found a bunch of free scripts which I could download. I edited them, fixed them. Made them better. I didnt even realize it but by the time I was done I became a pretty expeirence php users.

 

So I would recommend you find some short scripts online.

Link to comment
Share on other sites

You don't necessarily need a particular kind of math if you just want to do general programming, but the ability to think abstractly about a problem will help you. Maybe see this post. Maybe "advanced math" was the wrong term. You at least want to be sure you're confident with math and that you know something else besides elementary math. If you want to do something like computer science you would need advanced math though.

 

You can probably jump right into it without knowing anything. I did, but it really took a long time being at least decent this way (decent by the standards I hold now - when I was younger and just started out I probably pretty quickly found myself good, but I wasn't). You can get something done very quickly in PHP without very much knowledge, and I suppose that is what makes it so difficult. The problem is just that if you don't know anything, you will have no idea of what is good and what is bad to do. If you don't know any common attack vectors people will use, you will have no idea of how to protect yourself from them, or even that you're vulnerable to them in the first place (see this tutorial for a primer on security).

 

Don't be afraid to use the manual. It's quite well written, and it often contains notes about best practice.

 

@chmpdog: That sounds logical...maybe I'll try that once I learn the syntax.

 

@DanielO: Ok, I think I understand what you are saying now. *warning, metaphor coming* Basically, it works the same as in spoken languages. Someone can give you a dictionary, and you can learn the words all day long, but that doesn't mean you'll understand it when someone speaks to you. You have to learn the mentality of the language, word order, etc to be able to understand and make logical sense back to the person. You have to learn which phrases are idiomatic expressions, which phrases shouldn't be used because they are out of date...even though people may understand when you speak them.

 

(i.e. 'To be caught red-handed' isn't literal, and the infamous, "Make haste, woman!" 1. No one says make haste. 2. You don't regard your wife with, 'Woman!' True story. :D)

 

And, with regards to tutorials, people can teach you 'Common Phrases' forever, and you will be understood, but that will never allow you to create a conversation.

 

Am I getting the gist? [i'm a huge fan of metaphors, and languages...spoken and programming! XD]

Link to comment
Share on other sites

@DanielO: Ok, I think I understand what you are saying now. *warning, metaphor coming* Basically, it works the same as in spoken languages. Someone can give you a dictionary, and you can learn the words all day long, but that doesn't mean you'll understand it when someone speaks to you. You have to learn the mentality of the language, word order, etc to be able to understand and make logical sense back to the person. You have to learn which phrases are idiomatic expressions, which phrases shouldn't be used because they are out of date...even though people may understand when you speak them.

 

(i.e. 'To be caught red-handed' isn't literal, and the infamous, "Make haste, woman!" 1. No one says make haste. 2. You don't regard your wife with, 'Woman!' True story. :D)

 

And, with regards to tutorials, people can teach you 'Common Phrases' forever, and you will be understood, but that will never allow you to create a conversation.

 

Am I getting the gist? [i'm a huge fan of metaphors, and languages...spoken and programming! XD]

 

No to speak for Daniel, but yeah, that's a good way to look at it.

 

There are essentially two components at play here - syntax and semantics.  Syntax is the form and grammar of a language - which symbols are important, how they go together to form language structures (expressions, blocks, objects), etc.  The semantics are the meaning of what you're trying to do - validating user input, accessing the db, etc.

 

When you're learning to program, it's important to try to separate the two.  For example, you can access a database in PHP, Ruby, Java, C#, etc.  But how you do it - the syntax - changes from language to language.

 

As far as resources go, I think that this board is one of the best.  The reason is that you get to see real world problems, and, even better, real solutions to them.  It's far better than an author writing "Here's a canned example, set up from the outset as a failure, and now I'm going to fix it."  Not only that, but, aside from the PHP online manual, this board is also the best place to get ideas on what constitutes best practices.

 

You should also code as often as you can.  To use an analogy myself, it's like converting to a healthier lifestyle.  Dieting alone won't cut it - you need to exercise as well.  There's no substitute for actually getting your hands dirty and writing code.

Link to comment
Share on other sites

I think that's an excellent analogy.

 

@Nightslyr: I can understand. At this point, I think I'm going to go for syntax and then just code until my amount of errors lessens.

 

@DanielO: Fantastic! I had drawn that connection before...but hadn't really thought about it. I think I'm going to approach it like I would a spoken language...get the dictionary first, learn the idiosyncrasies and then speak with native speakers! Wow, that sounds very nerd-tastic.  :P

 

Thank you all for helping. You really have given me an incredible view of the next step...and while the next step is smaller than I thought it'd be, the rest of the stairway is twice as long!  :D

 

Thanks again! I'll probably be around here a lot more often, trying to get a grasp on this language.

 

-- Cat

 

PS: http://www.w3schools.com is INCREDIBLE. I completely understand CSS now.  :o Weird...

Link to comment
Share on other sites

PS: http://www.w3schools.com is INCREDIBLE.

 

As an aside, I wouldn't recommend that site for attempting to learn JavaScript.  It barely covers the bare-bones basics, and favors a coding style that I feel leads to long term problems if adopted.

 

I definitely would NOT use w3schools for php. It is confusing and unorganized (although their other tutorials are awesome) I have read this one and I thought it was helpful. http://devzone.zend.com/article/627-PHP-101-PHP-For-the-Absolute-Beginner#comments-1053

Link to comment
Share on other sites

PS: http://www.w3schools.com is INCREDIBLE.

 

As an aside, I wouldn't recommend that site for attempting to learn JavaScript.  It barely covers the bare-bones basics, and favors a coding style that I feel leads to long term problems if adopted.

 

I definitely would NOT use w3schools for php. It is confusing and unorganized (although their other tutorials are awesome) I have read this one and I thought it was helpful. http://devzone.zend.com/article/627-PHP-101-PHP-For-the-Absolute-Beginner#comments-1053

 

Whoa! Warnings! Yeah...I've only used it for CSS so far...from what I'm hearing I should stick with CSS on that site! XD

Link to comment
Share on other sites

Their AJAX tutorial has hurt more people than it's helped....  lol.

 

Hehe :)

 

It's funny...reading through the JavaScript section, I can always tell who went to w3schools.  The same problems crop up again and again.

 

 

Yeah...  The thing that sticks out to me the most is variable scope haha.  Then again, 99% of JS tutorials suck as far as variable scope goes.  (98.9% just suck.)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.