learning PHP

Discussion in 'OT Technology' started by Chaotic Reality, Dec 30, 2004.

  1. Chaotic Reality

    Chaotic Reality New Member

    Joined:
    Jun 22, 2004
    Messages:
    29,052
    Likes Received:
    0
    Location:
    Phoenix, AZ
    any recommendations on trying to learn? i have no previous programming background, i 'understand' the gist of PHP, and I can read it and know what it's doing for the most part, what I can't do is come up with an idea, sit down and do it...even if i do have an idea of what i want to do i'm at a loss as to really how to even start, and then i get frustrated and quit because i'm trying to learn on my own, i'm not forced to through a class or anything...maybe i'm not cut out for it but i refuse to think that cuz i have an interest in learning even after i calm down after getting frustrated over it.

    i'm pretty computer literate, i have my degree in information systems security and what not, but my degree never required any programming at all.

    Directing me to php.net and recommending books aren't great advice as i have plenty of books and know how to get to php.net. :)

    Thanks :big grin:
     
  2. skooter

    skooter Guest

    start small, make a small script to just write something to the screen then move on to creating variables and looping then start working with functions. once you get the whole basic programming down then expand your program to accept input from HTML forms and try to store the variables and things into flat files then retrieve the data, make a movie list or something useful to you so that you wont get bored with it and you can always expand it. after you do that type of stuff then you can start playing with databases and php to store your information instead of files, then you can get into classes. the way i learned was my dad rents out musical instruments and he writes down everyone's payments and things on paper so i started out with just inputting some basic stuff then retrieving information and every time i thought of something new to add to the program i would just figure out how to do it and implement it, dont try to jump in or else it will get really frustrating especially if you dont have too much programming experience, php is in my opinion a very lax language, there is no defining variable types or private/protected/public variables, well at least not in php4, but it is similar to some of the more traditional languages so it should not be too hard to pick up or translate from another language.
     
  3. IAMwhitey

    IAMwhitey New Member

    Joined:
    Nov 8, 2001
    Messages:
    1,010
    Likes Received:
    0
    Location:
    Pittsburgh, PA
    good advice... i started writing code to organize my CD collection... note this was like back in 97. before i was into dl mp3s. just do something you like, then it becomes fun.
     
  4. Chaotic Reality

    Chaotic Reality New Member

    Joined:
    Jun 22, 2004
    Messages:
    29,052
    Likes Received:
    0
    Location:
    Phoenix, AZ
    Starting small is a good idea...I think I'm expecting way too much out of myself, I expect to automatically know everything about it without having to do the work to learn it. Keep coming with the ideas. :)
     
  5. Chaotic Reality

    Chaotic Reality New Member

    Joined:
    Jun 22, 2004
    Messages:
    29,052
    Likes Received:
    0
    Location:
    Phoenix, AZ
    bump. more recommendations :squint: :x:
     
  6. Ximian

    Ximian New Member

    Joined:
    Mar 20, 2004
    Messages:
    1,860
    Likes Received:
    0
    Location:
    DCA
  7. Chaotic Reality

    Chaotic Reality New Member

    Joined:
    Jun 22, 2004
    Messages:
    29,052
    Likes Received:
    0
    Location:
    Phoenix, AZ
  8. MrMan

    MrMan New Member

    Joined:
    Jul 13, 2004
    Messages:
    308
    Likes Received:
    0
    People learn differently. I think you know the PHP language already. What you would need is a computer science book.

    This is a good computer science book (older edition just fine):
    http://www.amazon.com/exec/obidos/ASIN/0201781301

    This is another good structure of programming book (although it got mixed reviews from amazon, because it's a serious book, and the fact that the language used is LISP which isn't an easy language)
    http://www.amazon.com/exec/obidos/ASIN/0262011530

    The second book above can be found online free by its publishers:
    http://mitpress.mit.edu/sicp/

    The reason I believe this is that once you have an understanding of the theory behind it, learning PHP and any other languages will be easier. I, too, learn by doing and wanting to start coding right away, but at the same time, a background in theory is always helpful.

    But knowing you... and I, we'll try things first, get a hand of how it works, then try to fully understand it later. I have a background in computer science, and the way I learned PHP is by having a college professor give a final project and two weeks to complete it. This was a web design course, and he did not teach PHP nor anything server side programming language at all throughout the course. It was a group project, and most of the other students had somebody in their group who already knew PHP. One group had 4 people that knew PHP. I had a group of 2 and neither of us knew PHP. I spoke to the professor explaining that we do not know PHP and that he should have somebody in the other group moved to ours. He handed me his Beginning PHP/MySQL book and said, "here... learn it".

    Advantages:
    Computer science background.
    Programming experience (PHP is like C, C++).

    Disadvantages:
    No server-side scripting language experience.
    No database experience.

    And so I got to work, learned PHP/MySQL in a week, finished the project for the remaining week. That was my quick, hands on experience with PHP. After the semester, I bought a better PHP book with a deeper understanding to fully understand the language. So you can go by the first approach I suggested, learn theory, code. Or the opposite, code, learn how it works, then understand why it works.
     
  9. Juvenall

    Juvenall What Would Juvie Do?

    Joined:
    Dec 31, 2004
    Messages:
    2,221
    Likes Received:
    0
    Location:
    #!/usr/bin/Detroit
    When I started to pick up PHP, version 3 had just been let out of the bag. At the time, I was a big Perl guy so it wasn't a HUGE adjustment.

    At any rate, the best way to learn a new language, IMHO, is to simply dive right in. Find something you could use on a site you run (or would like to run) and go for it. In no time, you'll find yourself with a really good working knowlage of the language.
     
  10. Chaotic Reality

    Chaotic Reality New Member

    Joined:
    Jun 22, 2004
    Messages:
    29,052
    Likes Received:
    0
    Location:
    Phoenix, AZ
    thanks guys.
     
  11. DaIceMan

    DaIceMan Jack Bauer > *.*

    Joined:
    Aug 30, 2004
    Messages:
    3,475
    Likes Received:
    0
    Location:
    Springfield-ish, Missouri
    Fortunately, the guy that built our car club website built it in PHP, so I HAD to learn some stuff by just going in and doing it after he quit the team. I'm still a bit weak on starting from scratch, but I can edit most PHP with no problems.
     
  12. Yep

    Yep Knick knack paddy whack, give the old dog a bone

    Joined:
    Jan 22, 2001
    Messages:
    4,603
    Likes Received:
    0
    Location:
    South Jersey
    Slightly off-topic but is PHP derived from Perl? Back in the day I did a lot of Perl programming then slacked off and moved to VB. Now messing with PHP again it seems like just a slightly higher level langauge than Perl.
     
  13. intrktevo

    intrktevo New Member

    Joined:
    Oct 18, 2004
    Messages:
    5,781
    Likes Received:
    0
    Location:
    UCF
    from what i've noticed it seems a lot more based off of java than anything else
     
  14. samm

    samm Next in Line

    Joined:
    Dec 22, 2000
    Messages:
    2,630
    Likes Received:
    0
    Location:
    San Jose, CA
    :stupid:

    PHP was originally a set of Perl scripts. I think it was rewritten in version 3.0 in C.

    Edit: yes I was right, http://www.php.net/history
     
  15. intrktevo

    intrktevo New Member

    Joined:
    Oct 18, 2004
    Messages:
    5,781
    Likes Received:
    0
    Location:
    UCF
    i've never done any perl so :stupid:. was just pointing out my experiences
     
  16. Juvenall

    Juvenall What Would Juvie Do?

    Joined:
    Dec 31, 2004
    Messages:
    2,221
    Likes Received:
    0
    Location:
    #!/usr/bin/Detroit
    Perl is really one of the most powerful languages around. Anyone who runs a server should know at least some of the basics. Though, I would never recommend picking it as a "first language". A lot of the basic structure is so far and away from most others, it can be a real pain to try and pick up anything else.
     
  17. MrMan

    MrMan New Member

    Joined:
    Jul 13, 2004
    Messages:
    308
    Likes Received:
    0
    guess nobody read my long post. As I stated, PHP is like C, C++. :)
     
  18. Ximian

    Ximian New Member

    Joined:
    Mar 20, 2004
    Messages:
    1,860
    Likes Received:
    0
    Location:
    DCA
    Perl is like C, C++ and since PHP is like Perl...
     
  19. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
    any good books on php + xml/rss ??
     
  20. Chaotic Reality

    Chaotic Reality New Member

    Joined:
    Jun 22, 2004
    Messages:
    29,052
    Likes Received:
    0
    Location:
    Phoenix, AZ
    i'm reading PHP 5 and MySQL by W. Jason Gilmore. I like it so far a bit more than any of my other books...I'm not sure if there is any xml/rss stuff in it...I think a little xml stuff maybe..i'll let you know.
     
  21. Juvenall

    Juvenall What Would Juvie Do?

    Joined:
    Dec 31, 2004
    Messages:
    2,221
    Likes Received:
    0
    Location:
    #!/usr/bin/Detroit
    PHP and RSS is easy. All you really need to do is dump your data into the RSS format and you're good to go. So something basic like this:


    [font=verdana, geneva, helvetica]
    PHP:
            <?php
           
    //Call the script with your database functions or vars so we can get the data
           
    require ('/path/to/DBfunctions.php');
           
     
    //Now we take the details the script we just called and print them out in a basic RSS template.
           
    echo'
           <?xml version="1.0"?>
     <!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">
           <rss version="0.91">
               <channel>
                   <title>'
    .$title.'</title>
                   <link>'
    .$link.'</link>
                   <description>'
    .$ChanDesc.'</description>
                   <language>en-us</language>
                   <pubDate>'
    .$pubDate.'</pubDate>
               
                   <item>
                       <title>'
    .$ArticleTitle.'</title>
                       <link>'
    .$ArticleLink.'</link>
                 <description>'
    .$ArticleDesc.'</description>
                   </item>
             </channel>
           </rss>'
    ;
           
    ?>
          
    Like I said, that's really, really basic and does not include anything to loop through the articles (so your RSS can show more then one) nor does it get into pulling the data from a database..but as you can see, the basics of the file itself is REALLY simple.

    One of the best books I've ever found on functional PHP development is the book titled "PHP and MySQL Web Development" by Luke Welling and Laura Thomson.
    [/font]
     

Share This Page