Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Beginning to learn PHP – Any tips?

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #44003

    After my final GCSE exams in 5 weeks I’ll be continuing to learn PHP, really excited to get stuck into it again!
    Any tips?

    #131232
    CrocoDillon
    Participant

    http://www.php.net/manual/en/langref.php, I learned PHP by following their manual, and practicing.

    #131251

    Thanks!
    How long did it take you?

    #131256
    rpotterjr
    Participant

    It’s something that will vary from person to person in terms of how long it will take you to learn php. A majority of learning php is trial and error, and occasionally maybe a little help along the way. It’s not something you will be able to learn over night. One thing that you want to make sure of is that you pay attention to how you program. Take the time to learn about common mistakes made in php programming that leave your website/ application vulnerable to security problems.

    #131257
    __
    Participant

    If you understand the basics of how the language works – how to use functions, how stuff is output – then the rest of it is just memorizing what commands to use for what results.

    Couple things that lots of people get hung up on:

    … PHP runs **first**, on *the server*.

    HTML/JavaScript run **after**, on the user’s *browser*.

    … once you use PHP, *everything* is PHP. Even plain HTML (outside the `` tags) is PHP output.

    (because of that, I always strive to put all PHP *first* in my scripts, and all output *last* – there are many problems (with sessions, cookies, nice, clean error handling, etc.) you can avoid that way!)

    … `die()` **must die**

    (many tutorials use `die()` for giving error messages – *don’t!*)

    … **never trust user input**. `$_GET`, `$_POST`, `$_COOKIE` – any info you get from your users must be validated (i.e., to make sure it *is* what you *expect*) before use. Sticking it in MySQL queries, emails, HTML output, or almost *any* use in your script can cause serious problems, even if the user is not being intentionally “evil.”

    (speaking of MySQL, many tutorials use the `mysql_*()` functions – **they are now deprecated and should not be used**. Learn to use the [mysql**i** extension](http://php.net/mysqli) or [PDO](http://php.net/PDO) instead!)

    Good luck! Ask if you have any questions!

    -Adrian

    #131260

    Thanks everyone, It’s something I’ve looked into for a while now and will soon be committing all of my time away from school too, I’m really excited to begin learning some more!

    Is it best to learn MySQL after becoming confident with PHP or at some point during learning?

    #131265
    CrocoDillon
    Participant

    > Thanks! How long did it take you?

    I’m still learning :P

    You can learn MySQL parallel to PHP, once you start using PDO (or mysqli) you’ll need it.

    If you want to be serious with PHP it might be useful to learn the concepts of Object Oriented Programming, and learn a MVC framework (using a good framework will improve your OOP skills if nothing else). But start with basic PHP first.

    #131313
    __
    Participant

    Keep in mind that MySQL is its own language; too many people think of it as a “subset” of PHP, and that leads to problems too

    : )

    #131380

    Thanks everyone, I’ll keep you all posted!

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Back End’ is closed to new topics and replies.