Jump to content
xisto Community
Lightning73

How Did You Start Learning Php?

Recommended Posts

I just learned it by downloading a completed game project coded in PHP, which was full of bugs. Then I started fixing those bugs while figuring out what every function did by just trying and learning.But you honestly just never end learning PHP, I've been doing it for 5+ years now and yet sometimes I still discover new things to use.So, tell us, how did you start learning PHP?

Share this post


Link to post
Share on other sites

Well i was always interested in computers, hacking, coding etc... so i started leaning HTML. Then i wanted to code one of those 007crush style sites where a user fills in details for a love score or some crap and instead it gets emailed to whoever. I knew HTML so i coded the form but needed to send an email. I tried Javascript but got confirm messages and email clients and all the rest of it so i learned basic GET variables and mail() in PHP. Since then ive worked up to creating whole sites, logins, sessions, file and DB management etc... and still the mail() function is in use :) I think the ONLY way to lean php is to do it. Theres no point in reading a book because you just copy. Set yourself a task like "i want to make a PHP script to take user input, validate it, and save it to a DB" and then google things like "PHP input validation" "php mysql insert query" and go from there, you will copy some lines, sure, but you will learn a lot of it and repetition will ingrain it in your mind and you wont forget it. Then add to that code like "i want to get that data out of the DB set it into an array, echo that data out in a HTML table, then make links for someone to edit those DB entries, oh and i need an admin login, and session management, MD5 hashing" and so on. It just gets bigger until youve made a complete user login site with user management, mailing lists etc... If you are reading a book on PHP stop! You need to do it! Read the book to learn the stuff but always do it yourself every time you learn something new practice it!

Share this post


Link to post
Share on other sites

Well, for me, I heard some friends in school who wanted to make a website, so I went to the local library, and checked out like 10 books on making websites and HTML. After reading those books, I made a simple website. On one of the books it had W3Schools, and I went there and learned PHP and SQL. So that's practically how I learned it. I've tried reading PHP, and they don't do anything, really, so I don't recommend them, as said by shadowx above.

Share this post


Link to post
Share on other sites

Actually I am java programmer. I didn't know anything about PHP. I started designing a website using jsp as my server side scripting. Then I searched for free hosting on internet. I didn't find even a single webhost offering free jsp hosting. But many were providing free PHP hosting. So I started learning PHP on my own. I was really amazed with its simplicity as well as speed. PHP is very easy to use and powerful as well. I started learing PHP by downloading various books and videos available on different websites. Of course, reading is not enough. Practice is very important in programming. Practice is the key for my comfort with PHP.

Share this post


Link to post
Share on other sites

That is exactly my point too.I have a number of books on PHP/MySQL, but all they do is let you copy things.What I am looking for is a book that explains things to you and then gives you some exercises, eg. it explains about login procedures and then at the end asks you: 'Now write a routine that logs into a Myo things I want to achieve which CoffeeCup cannot do.SQL database, writes a line of data into it, and then emails the results of that inoput back to you', or something the likes of that. I think I have also relied too much on CoffeeCup Web Form Maker to help me out, this definitely makes it easy, but you do not learn from it, and, there are also things i want to achieve which coffeeCup cannot do.And, Xpress, you had prior knowledge of programming with being a Java programmer, which, I assume made it somewhat easier to learn a different programming language.All I have is some knowledge of Commodore 64 Basic I learned in the 80s and some Pascal I learned on that same Commodore 64. (Although that was many years ago).So, if any one has further advice on learning PHP, it will be gratefully accepted.

Share this post


Link to post
Share on other sites

And, Xpress, you had prior knowledge of programming with being a Java programmer, which, I assume made it somewhat easier to learn a different programming language.

Yes, I agree. Having a prior knowledge in some programming language will definitely makes it easy to learn a new programming language. But PHP is not hard. You can learn it easily by reading. All just you need is some knowledge in HTML and a database(for example, MySql).

 

If you know some basic programming skill, for example using if statements, for loops, while loops(these are almost same on all latest programming languages like C,C++,Java and many) functions etc... you are ready to write your programs in PHP by reading any book(Of course not only PHP, but any language). Because these are basics. You should know and understand them. The only way you can understand these basics is practice, practice and practice only. Practice these until you are comfort with them, and you'll find how easy it is to learn PHP. You can use any book you have.

Edited by xpress (see edit history)

Share this post


Link to post
Share on other sites

Thank you for your advice.Even back in the 80s, the Commodore 64 built in BASIC included if...then statements, for...next loops (do and while came a bit later, but I do to some extent understand them), and then there were also the GOTOs and GOSUBs, as far as that is concerned I should be OK.I am also fairly familiar with HTML (use it on a regular basis), but one problem I seem to encounter with most books I have about PHP is that they all start with the famous "Hello World" program (ie. a program that prints "Hello World" on your screen), but then they move so fast, and almost immediately the programs become so complex that it is almost impossible to follow.I also have "PHP and MySQL for Dummies", well, then, that really raises the question, "how many PhDs do you need before being called a 'Dummy').But anyway, as soon as I have time, i shall put my nose into some books again and try to learn a few things.Any further advice will obviously always be welcome.

Share this post


Link to post
Share on other sites

I took my first steps in PHP with help from this tutorial: http://www.w3schools.com/php/ ; it's really well structured and very easy to follow.
If you don't like to read to much you can always watch the lectures from Harvard's David Malan which you can find right here: http://cs75.tv/2012/summer/
These lectures were a real source of inspiration for me.

Share this post


Link to post
Share on other sites

I've only just started learning PHP. Im learning it through Tutorials on a variety of websites. Im just learning the basics, then Im going to move to the bigger stuff :)

Share this post


Link to post
Share on other sites

for me I learned PHP when i created a blog-like website.. I downloaded tutorials with scripts and studied every functions..books won't work because for me you will not know how a script will work until you try and make your own using a different script but will make same result..

Share this post


Link to post
Share on other sites

I think the ONLY way to lean php is to do it. Theres no point in reading a book because you just copy. Set yourself a task like "i want to make a PHP script to take user input, validate it, and save it to a DB" and then google things like "PHP input validation" "php mysql insert query" and go from there, you will copy some lines, sure, but you will learn a lot of it and repetition will ingrain it in your mind and you wont forget it.

I could not agree more with you here. This is exactly the right way to start learning any new programming language in my opinion. When I wanted to start learning php, I bought a big PHP book, which was a huge mistake because I found that it never helped me learn anything. Like shadowx says, you need to sit down, and program something.

Share this post


Link to post
Share on other sites

I did the same as I always do when learning a new language.I look for a good tutorial an a reputable site, and learn some of the basics from that.Then I get some source code from free source code sites, and customize it to learn how it works, and how to change it etc.Then I bought a couple of books about it, to help learn the difficult stuff, as i often ind the web tutorials not very helpful, and make you assume stuff way to much.One of the books I bought was the PHP and MySQL bible, and its brilliant, I have bought a few books from that range, and they are all really good!

Share this post


Link to post
Share on other sites

hands on is better than any other way of learning a new programming language..

just like this:

<?phpsetcookie('user', 'username', time()+3600);if (isset($_COOKIE['user'])){	echo "You are logged in: $_COOKIE['user'] Enjoy.";}else{ 	echo "You are not logged in. <a href='register.php'>Register here</a>";}?>

if you're a beginner and will just look on a book you'll never find what is this for.. you should try first a program to know the what the program and the SCRIPT is for..

Share this post


Link to post
Share on other sites

hands on is better than any other way of learning a new programming language..
just like this:

<?phpsetcookie('user', 'username', time()+3600);if (isset($_COOKIE['user'])){	echo "You are logged in: $_COOKIE['user'] Enjoy.";}else{ 	echo "You are not logged in. <a href='register.php'>Register here</a>";}?>

if you're a beginner and will just look on a book you'll never find what is this for.. you should try first a program to know the what the program and the SCRIPT is for..

Lol I've seen a part of that script at least a million times now. It's almost routine to write something along that line of code if I'm writing something in PHP that requires a login system. :lol:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.