SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow Getting Started with PHP

    What is the best way to get started with PHP? I have experiene in XHTML and CSS, and some in C++ and python.

    Is the tutorial on the official site that good (I found it quite un-user friendly) or are there others I would benefit from?

    Also, do you have to be extremely careful when programming in PHP and check for vunrebilities? I hear a lot about this. Thanks.

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The php manual is definitely good and is very handy, it's your best friend when it comes down to this.

    And yes, you have to be extremely careful, poorly written apps are vulnerable. The internet is a medium that you must be cautious developing your apps, not only php.
    Saul

  3. #3
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pm63 View Post
    What is the best way to get started with PHP? I have experiene in XHTML and CSS, and some in C++ and python.

    Is the tutorial on the official site that good (I found it quite un-user friendly) or are there others I would benefit from?

    Also, do you have to be extremely careful when programming in PHP and check for vunrebilities? I hear a lot about this. Thanks.
    You could start a flame war over THE MANUAL. People with the right aptitude or who are experienced at PHP find it very useful. I'm one of many who find it mostly a waste of time. In fact, I copied a script from there just minutes ago, that I can't get to work.

    I jumped into PHP head first two or three years ago, and I'm still struggling with it, though I find it way cool. One piece of advice:

    If I could do it all over again, and if I could afford it, I'd hire a tutor - someone who could sit down right next to me and talk me through the basics. I'm not talking about a 24/7 babysitter; just someone to explain the basics, give you some tips about various things that are going to hit you over the head (like global variables, SQL injections, url_encode, etc., etc.) and give you some working scripts to play with.

    I suspect you might find someone willing to do that for $100; it sure beats beating your brains out for two or three months.

    If you're going to take on PHP, you'll probably want to learn about databases, too. So you might also want enlist the services of a tutor to help you get your MySQL program (and phpMyAdmin) squared away, as well as create a few simple tables and publish them online.

    I found all of this a wrestling match the first time around, and you could save so much time if you had someone to help you.

    If you do hire a tutor, do a little homework first. Learn whatever you're capable of learning on your own, and try to come up with a list of sensible questions for whoever's going to help you.

    In fact, I just started a "PHP Checklist for Beginners"
    http://www.sitepoint.com/forums/show...05#post3286405

    It's pretty useless right now, but it might be a good resource if people add to it.

    Note, also, that you can download software bundles that include Apache, PHP, MySQL and related programs. A very popular one that I use is XAMPP, put out by "Apache Friends."

    However, I'm in the process of switching to Apple/Mac. I discovered that Apache and PHP come preinstalled on Macs, though I ran into some problems when I tried to set up virtual servers. I messed something up and haven't figured out how to fix it yet.

    Anyway, virtual servers is something you'll want to add to your checklist, whether you're on a PC or a Mac.

  4. #4
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The manual certainly isn't a waste of time; God, it's saved my life a number of times over the years; You'll get the most out of it once you've learnt how to use it however.

    Tutor? Wtf??

    If you want to learn PHP, or any other language for that matter, a -beep- tutor isn't going to help you; They're not going to be there for you when the going gets tough... Wtf??

    The only way to develop is to learn; What you don't (particularly) know you go off and learn about it; Google it and once you find something, take it from there, but don't just rely on the one source. If you can't find something worthwhile with one set of key words, juggle them about - vary them.

    Pay attention to the various PHP Blogs as well, there is a wealth of information on a number of them, but you'll learn a few things there which you want to memorise for future reference; Keep upto date via their RSS Feeds...

    They're there to help you after all Don't install XAMPP as it's complete -beep- but instead install the WAMP you find here,

    www.wampserver.com which is much better and if you ever have a problem, the site support is excellent. If you are worried about security, then take a jump into this blog,

    www.shiflett.org and buy the book whilst your there.

  5. #5
    SitePoint Zealot backtobasics's Avatar
    Join Date
    Aug 2006
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston View Post
    The manual certainly isn't a waste of time; God, it's saved my life a number of times over the years; You'll get the most out of it once you've learnt how to use it however.

    Tutor? Wtf??

    If you want to learn PHP, or any other language for that matter, a -beep- tutor isn't going to help you; They're not going to be there for you when the going gets tough... Wtf??

    The only way to develop is to learn; What you don't (particularly) know you go off and learn about it; Google it and once you find something, take it from there, but don't just rely on the one source. If you can't find something worthwhile with one set of key words, juggle them about - vary them.

    Pay attention to the various PHP Blogs as well, there is a wealth of information on a number of them, but you'll learn a few things there which you want to memorise for future reference; Keep upto date via their RSS Feeds...

    They're there to help you after all Don't install XAMPP as it's complete -beep- but instead install the WAMP you find here,

    www.wampserver.com which is much better and if you ever have a problem, the site support is excellent. If you are worried about security, then take a jump into this blog,

    www.shiflett.org and buy the book whilst your there.
    I agree.

    p.s. geosite, your websites hurt my eyes.

  6. #6
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston View Post
    The manual certainly isn't a waste of time; God, it's saved my life a number of times over the years; You'll get the most out of it once you've learnt how to use it however.

    Tutor? Wtf??

    If you want to learn PHP, or any other language for that matter, a -beep- tutor isn't going to help you; They're not going to be there for you when the going gets tough... Wtf??
    Huh? I think I mentioned something about a tutor NOT being a 24/7 asset, but a person who can help get you started. You can learn PHP by trial and error, through tutorials, through peer mentoring via SitePoint or other forums, or with a tutor. Common sense says a tutor is the QUICKEST way to get up and running. Period.

    The only way to develop is to learn; What you don't (particularly) know you go off and learn about it;
    You mean you can't learn from a tutor? You can't learn by taking apart a working script someone gives you?

    Google it and once you find something . . . Pay attention to the various PHP Blogs as well, there is a wealth of information on a number of them, but you'll learn a few things there which you want to memorise for future reference; Keep upto date via their RSS Feeds...
    Yes. Unfortunately, there's sometimes TOO MUCH information; it can be overwhelming. Or you have to dig through a dozen tutorials before you find a good one. Was the tutorial written specifically for PC or Mac? A particular Windows or browser version? WTF? Why waste your time just searching for a good teacher when you can enlist the service of a tutor who can cut to the chase? Again, it's simple common sense.

  7. #7
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Some people need hand holding through every step, but in my opinion they are less likely to be taking steps to learn any programming - they are going to get stuck all the time. Why think when you can just keep asking questions all the time?

    FWIW, here's my oft-proferred advice. Go downtown to a good bookshop and browse the PHP books - theres lots nowadays. Look in the index, read the covers, read "who this book is aimed at", skip a few chapters, leaf through and see if it speaks to you. Visit more than one bookshop if you can.

    (this book buying process is one I go through once a year... I really look fwd to it! Foyles, London)

    If you get engrossed in the book then buy it.

    Do some homework then come back here ANYTIME. Learn how to use the search first though!

    The online man is completely awesome. You will find posters referencing it all the time - wanna know all about the explode function? www.php.net/explode

    Now, as I said, for me that learning tough stuff from books system has always worked - you might learn in a completely different way, online etc.

    Good luck!

  8. #8
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    > but in my opinion they are less likely to be taking steps to learn any programming - they
    > are going to get stuck all the time. Why think when you can just keep asking questions all
    > the time?

    Exactly my point; You don't actually learn (quickly enough) because you become too dependent; The other disadvantage of using a tutor is that you are only ever going to get their prespective on a matter... There isn't any other insight into the problem at hand, nor for that matter, the learning process.

    You have to learn how to break a problem down, to be able to find a solution yourself; If a tutor is going to hand you a premade solution, well what do you expect?

    In the early days, sure your own solution isn't good enough, that it can be done better. Of course it can be done better; I've a tonne of script that can be done better; It could be better tested, etc. But it takes time to make those refactorings, and always you will find that you learn better ways of doing something; The human mind is a powerful beast but you'll only ever discover that if you are willing to learn...

    Okay... It is difficult for a lot of people, in the beginning to learn, but individually we can all learn, at our own pace, some quicker than others, but that's what makes us human; At any time, who said we are up against a stop watch?

    As for getting lost in a number of tutorials, you learn (quickly, I might add) to separate the wheat from the chave; You get a good idea to where to go to, to find the information you need, and where to stay away from.

    Something tells me there is something wrong if you keep going back to the same old source that is, in the first place causes a distraction

    As I said earlier... Tutors? Wtf??

  9. #9
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The manual is marvellous. I'm always returning to it.

    If you have a site that you need to get up and running quickly it might be best to start with a packaged CMS (Mambo, Joomla, etc). Most of these provide a useful framework to get a site up and running quicly, and you can then use the framework to add your own customisations. It also helps that you can see good php code in action.

    As soon as you can it would also be useful to learn how classes work in php. Its not only good programming practice, but you find you can reuse the same classes over and over again to save more programming time. Once you are more experienced in PHP you might want to check out the PEAR repository (www.pear.php.net) - but it is probably a bit complex for you right now.

    So my advice is:

    1. Check out Joomla or Mambo - a good framework will get you up and running fast
    2. Get thee to a bookstore - hundreds of titles - get a good book on the basic syntax etc
    3. Don't diss the manual - it will become your best friend

  10. #10
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston View Post
    Exactly my point; You don't actually learn (quickly enough) because you become too dependent; The other disadvantage of using a tutor is that you are only ever going to get their prespective on a matter... There isn't any other insight into the problem at hand, nor for that matter, the learning process.
    Huh? Do you think all beginners are idiots? You think once they've spent four or five hours with a tutor, they're totally dependent on that individual?

    Reality Check: You can still consult online forums, tutorials, even THE MANUAL even after you've consulted with a tutor. If you stop and think about it, tutorials and the Manual were written by people, and it's stupid to think that these people would somehow give you a lesser learning experience if they - *gasp* - actually sat down with you and talked to you.

    A good analogy is cars. Lots of people like to know all there is to know about them. They like to strip them down and rebuild them. That's a fine hobby, but most normal people don't have time for that sort of thing. They'd rather use cars for transportation, leaving time for other things.

    Same thing with PHP, databases and other things high-tech. Some people are inclined to learn all they can about them, and they can be great teachers - assuming they also know how to teach (not always the case). But some of us simply don't have time; why spend two days wrestling with a script from the Manual, when someone on a forum can show you how it works in minutes - and possibly give you a better script to boot. That's another thing to keep in mind: The technology is always changing, and if you rely only on online tutorials and manuals, you aren't always getting the latest and best fixes.

    Something tells me there is something wrong if you keep going back to the same old source that is, in the first place causes a distraction
    But I don't; I already said I don't have much use for the Manual. It was written by geeks for geeks.

  11. #11
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spunkymungbeans View Post
    The manual is marvellous. I'm always returning to it.

    If you have a site that you need to get up and running quickly it might be best to start with a packaged CMS (Mambo, Joomla, etc). Most of these provide a useful framework to get a site up and running quicly, and you can then use the framework to add your own customisations.
    I make my own CMS's. It's been a lot of work, but it's nice having a system you understand. The amazing thing is how hard it was to find good tutorials on building a CMS; the basics turned out to be surprisingly simple. I experimented with Mambo and a few others, but they were more difficult than I expected. In the end, I decided I'd rather invest the time and effort in something I made myself, rather than a system that likely has lots of stuff I don't even need.

    However, I'll be latching on to a pre-made CMS as soon as I'm ready to launch a blog or forum.

  12. #12
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My day to day programming is with a framework that started out as Mambo, but I ended up hacking it so much that it now pretty much my own. There are some great frameworks out there (eg Seagul) but for a php newbie that might be a hit like jumping in the deep end, which is why I suggested some of the pre-packaged CMSes.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •