How did you learn PHP?

Discussion in 'Tech Discussion' started by Nom de Plume, May 16, 2019.

?

What’s your PHP knowledge?

  1. None

    39.0%
  2. Entry Level

    19.5%
  3. Practiced

    4.9%
  4. I’ve completed one project for fun

    17.1%
  5. Mastered

    12.2%
  6. Professional

    7.3%
  1. Nom de Plume

    Nom de Plume [Shio’s Disciple] [True Villain] [Equip: Gunblade] Novel Updates Staff

    Joined:
    Oct 20, 2015
    Messages:
    2,693
    Likes Received:
    13,032
    Reading List:
    Link
    I would like to learn PHP & HTML5 for the purposes of web development.

    Does anyone have suggestions about where to start? I’ve made websites (offline) in the past using HTML4, CSS, and JavaScript. It was very amateur stuff with tables used to format where I wanted page elements. (Is that still a thing?) This means I am still a beached whale when it comes to PHP and HTML5. How did you learn these things, if you have?

    I’ll be back in a few hours, but I am open to tutorials, refreshers, dictionaries...

    I hope you’re happy @Tony
     
    Last edited: May 16, 2019
  2. Nom de Plume

    Nom de Plume [Shio’s Disciple] [True Villain] [Equip: Gunblade] Novel Updates Staff

    Joined:
    Oct 20, 2015
    Messages:
    2,693
    Likes Received:
    13,032
    Reading List:
    Link
    Stories about learning PHP (for web development or not) are also very appreciated. + Fun

    /o/
     
  3. J-Mitch

    J-Mitch ⚖ Tipping the Scales of the World

    Joined:
    Mar 11, 2016
    Messages:
    1,922
    Likes Received:
    3,759
    Reading List:
    Link
    Best thing to do is start building. I built CrN just from starting.

    If you have a project in mind, find out what you want to do, and look online. Break down the code they use, step by step. Learn what a 'function' is..etc. Learn shortcodes.

    Consider... "How do I apply this?" and soon enough, you'll learn.
     
    Nom de Plume likes this.
  4. Nom de Plume

    Nom de Plume [Shio’s Disciple] [True Villain] [Equip: Gunblade] Novel Updates Staff

    Joined:
    Oct 20, 2015
    Messages:
    2,693
    Likes Received:
    13,032
    Reading List:
    Link
    Handling user access and accounts in particular is what I struggle with the most. The rest I can do okay using that method, but I worry about security... since it confuses me! Lol
     
  5. pentadrian

    pentadrian Wandering donut

    Joined:
    May 15, 2016
    Messages:
    1,146
    Likes Received:
    1,451
    Reading List:
    Link
    Why stop at PHP? You can also learn Latin, Prakrit, Sumerian and other dead languages! All for the small price of wasting your life!
    In fact, apply your face to the keyboard liberally. Still less painful than PHP!

    Source: Used to use PHP. Switched to JS. Now I just do backend stuff ( ͡° ͜ʖ ͡°)
     
    DarkBlue, Nom de Plume and mir like this.
  6. Nom de Plume

    Nom de Plume [Shio’s Disciple] [True Villain] [Equip: Gunblade] Novel Updates Staff

    Joined:
    Oct 20, 2015
    Messages:
    2,693
    Likes Received:
    13,032
    Reading List:
    Link
    I’ll be coming back to like this tomorrow! *serious threat*

    I’m out for the day xD
     
    AliceShiki likes this.
  7. J-Mitch

    J-Mitch ⚖ Tipping the Scales of the World

    Joined:
    Mar 11, 2016
    Messages:
    1,922
    Likes Received:
    3,759
    Reading List:
    Link
    It depends, I guess. Are you using Wordpress or Drupal? Or is it straight PHP?

    Depending on what you are using, you'll have to worry over.

    1. Scrambling passwords. - Even if you go into the database, you should not be able to get a users password and use it.
    2. Processing.
    3. MYSQL/PHP statements. You want to make sure you are cleaning your input. If your input is not clean, you can have an SQL injection.
    4. Cleaning your output.
    5. Browser support. (As browsers change, html is different. Cookies can autosave data, and things can come out weird. )
    6. Caching. Just be careful. Don't want people being able to log into other's accounts.

    It's simpler with Wordpress. Most of that is done for you.
     
    Nom de Plume likes this.
  8. methael

    methael Well-Known Member

    Joined:
    Aug 12, 2016
    Messages:
    79
    Likes Received:
    57
    Reading List:
    Link
    Forget PHP for now.... If you want to do web development, do JavaScript. You can use it now a days to do both front end and back end. Unity also uses it for game development. Learn java to write servlets and maybe applets (not necessary but good as object oriented programming is very big). HTML and CSS arent hard to learn but are hard to master. Come up with the project for yourself and work on it. Its all about practise and a project is excellent practise.

    For example, write a website that handles some sort of a game. Like tictactoe. You can have your userbase stored in your sql database. Each user would also be able to keep track of their score as it would be stored in the database. Its not a too hard of a project. It will require a lot of research on your part to figure out which tools would be appropriate. Im not a web developer, so im not aware of it all. But i believe javascript has a library that can handle sql, i think. ( if php is one of the required tools that you would nerd then excellent. If not you can find a way to implement it. )

    Write a game first. Then add loggin option and register option. Then connect this register and loggin to database.

    This would be an excellent small project to get you started, i remembered doing something like this awhile back during training. We used java swing to make a game and then jdbc to connect to a database.
     
    Nom de Plume likes this.
  9. checkman123

    checkman123 [Nez] [The Bystander][RAWR FEAR ME]

    Joined:
    Mar 23, 2016
    Messages:
    360
    Likes Received:
    565
    Reading List:
    Link
  10. Deleted member 155674

    Deleted member 155674 Guest

    Reading List:
    Link
    Well, if you want just to build websites then a CMS software (like Wordpress, Joomla, etc...) are more than enough as they come equipped with the recent updates and if something lacking you can add it yourself (practically they offer all that you need to start up your website as fast and easy as counting 1 2 3 ...) however, if you want to touch and develop or start whatever project in mind from zero, I suggest you learn or work with a framework (for me I like using symfony when working with PHP), as for tutorials or lessons(if you want) well, you can search online or go to youtube, but I suppose openclassroom or codeacademy (these two sites that I recommend but there many more and the choice is yours, choose what you want)
     
    Nom de Plume likes this.
  11. Nom de Plume

    Nom de Plume [Shio’s Disciple] [True Villain] [Equip: Gunblade] Novel Updates Staff

    Joined:
    Oct 20, 2015
    Messages:
    2,693
    Likes Received:
    13,032
    Reading List:
    Link
    I see... and I hadn’t decided.

    JavaScript is very powerful but everything has flaws. I am looking to learn more, I enjoy the process of learning and it gives me more adaptability when I actually need to apply knowledge. :)

    Thanks haha

    Actually, looking up symfony and reading about it answered a lot of my questions! This page comparing what can be accomplished with PHP alone and with symfony in particular. I love making templates pretty early when making a webpage to get a better idea of what the end target should look like. My problem has been finding what PHP can accomplish and how. This concisely told me what I wanted to know by downtalking PHP. And I may just try out symfony too.



    Note to all: I’ll probably learn by making a wiki type site to practise with. My weakness is never having worked with users, and I think this format isn’t too challenging on the front end. Meaning I can focus on improving my main concerns in the back end. Front end and making things pretty are not difficult to me even if I lack experience, and can be learned later. /o/
     
    Deleted member 155674 likes this.
  12. Invisalats

    Invisalats The Bearded One

    Joined:
    Jul 20, 2016
    Messages:
    781
    Likes Received:
    977
    Reading List:
    Link
    I haven't messed with that stuff for like 16 years (php and HTML in general). I was always pretty noobish at it though...
     
    Nom de Plume likes this.
  13. sirin423

    sirin423 Well-Known Member

    Joined:
    Aug 3, 2016
    Messages:
    121
    Likes Received:
    267
    Reading List:
    Link
    ok, when i began to learn php I already knew how to program in other languages, but seeing that you are starting right now you need to learn adequately about the different programming paradigms, you do not need to know them all you could focus on object oriented programming but do not stay alone with that and learn a little more about others.
    you will need to learn about data structures, lists, stacks, queues, graphs, etc.
    also learn about algorithm analysis, systems theory (the latter is not only for computation, but it is useful)
    and also design patterns if you want to do a project well, you will probably have to use them.
    all of the above applies to almost any language.
    already focusing more on the topic of web development the basics is html learn their tags, css and javascript, but you do not need to become a sage, you could start first with libraries like bootstrap (any other is useful, but is the one I use) many tutorials about how to use it, even the same documentation tells you how to do each component.
    in real life it will not be very common for you to be asked to make web pages from scratch, so using bootstrap or similar will help you reduce the time needed.
    once you are able to make appropriate pages with the podiras you can start trying to achieve the same effects but without it, for example try to implement a grid system but without extra libraries only with html, css and javascript. and so on until you achieve a page equal to or similar to what you can do with bootstrap.
    On the back-end, assuming you have dealt with what I mentioned at the beginning you would have almost everything you have to learn, you just need to learn a few things like handling sessions, receiving and sending requests, encrypting passwords, simple measures of security to avoid sql injection, uploading files to the server and a database, send http requests to other servers, sending emails and some other things with which you will surely find but in the end are just a few lines of code.
    then comes the issue of joining the front-end with the back-end, at the beginning you can do the basics, embedding php code in your html (not recommended), but then you can use ajax to make requests to the server, and to do Make your website more dynamic
    As for where to find it, you can look at the large number of tutorials, videos, and books that are on the internet.
    other things that you will have to learn, is to use the linux console, to use git and github, they are not obligatory but in the case of linux you will surely find it when you have to deploy a moderately important web, you will have a server, and a console and you will have to fix them to put your web in operation only with it.
    sorry if some things are not understood well, English is not my native language and I had to ask google sensei for help.
     
  14. Nom de Plume

    Nom de Plume [Shio’s Disciple] [True Villain] [Equip: Gunblade] Novel Updates Staff

    Joined:
    Oct 20, 2015
    Messages:
    2,693
    Likes Received:
    13,032
    Reading List:
    Link
    It's well written and I understand what you are saying. ^_^


    I'm curious... although I am not aiming to be employed in this field. What are web developers usually asked to create from?
     
  15. pentadrian

    pentadrian Wandering donut

    Joined:
    May 15, 2016
    Messages:
    1,146
    Likes Received:
    1,451
    Reading List:
    Link
    Well, if you're doing it as a hobby app, outside of an Enterprise environment, a combination of Bootstrap/React/Vue with a Node/Go/Python server would be perfect for 95% of the applications you wanna host
     
  16. lnv

    lnv ✪ Well-Known Hypocrite

    Joined:
    Jan 24, 2017
    Messages:
    7,702
    Likes Received:
    9,044
    Reading List:
    Link
    As someone with over 20 years of programming experience, including web programming since the 90s, I agree with their advice of using javascript. It will make your life a lot easier that you have to learn only 1 programming language instead of 2 or 3.

    Backend javascript, aka NodeJS has gotten enough maturity for it to be a serious contender and it is far more flexible than PHP. PHP limits you to only making webpages for the most part, you will still need to know javascript for front end and another language for server backend apps (like Perl). In comparison, javascript can do front end, back end, browser extensions, mobile apps, server backend apps, desktop apps and these days even 2d and 3d games.

    Javascript has changed a lot, with ECMAScript 5 and 6, a lot of convenience functions have been added and the syntax has been made a lot cleaner.

    PHP was originally a web template plugin for Perl. It eventually branched out of Perl and became its own programming language. It's goal was to simplify Perl for the common person at the expense of functionality. Thus it took off as a more easier language than Perl(CGI) to work with for web development. With introduction of NodeJS, PHP's marketshare has been dropping as Node can do everything PHP can and more while at same time being easier to learn due to less languages needed.
     
    Nom de Plume likes this.
  17. NodiX

    NodiX Well-Known Member

    Joined:
    Jul 25, 2017
    Messages:
    223
    Likes Received:
    148
    Reading List:
    Link
    The article linked above isn't that relevant anymore. Javascript changed a lot and changed swiftly.

    In the article it says "really, who doesn't use JQuery nowadays"--that was five years ago. Nowadays, in 2019, JQuery's been losing its popularity and the big wigs nowadays are React, Angular, and Vue, while new type of compiler JS framework like Svelte slowly getting its foothold to distrupt the status quo in near future. The coming of reactive JS frameworks is changing the javascript landscape more than the JQuery's AJAX era.

    And the article basically nags at Javascript's dynamic characteristic, it lacks of type support and its unpredictable behaviour during the runtime. These weaknesses, however, have been mostly fixed with typescript. Learn typescript in case you worry about the type system.

    Nowadays it's already late to learn PHP. It's a server language that exclusively for the webs but even that other language like Go, Rust, Python, arguably better than PHP. The only reason to learn PHP right now is to look for jobs because it's a mature language and web masters from before the rise of Nodejs still run their businesses on PHP.

    If you want to learn a web language for fun then there's no reason to overlook javascript. Even with static hosting like github pages and netlify you can build a web app powerful enough to challenge enterprise-level sites without having to pay for the hosting--and nowadays, client side web apps getting more supports as companies like Google and Netlify provided security measure to hide third-parties' secret API keys that has been Javascript client-side web apps' weakness a few years ago.

    And don't forget about Google's Firebase. Last time I checked it's still exclusively for Nodejs and Javascript except for its cloud function. Firebase let you set up user auth system ridiculously easy and Firebase has a very generous free plan that completely unlocks all of its feature.

    Forget about what someone said about javascript five years ago. Learn javascript.
     
    Last edited: May 16, 2019
    Nom de Plume likes this.
  18. DarkBlue

    DarkBlue «Darker Than Blue» «Overlord of Sleep»

    Joined:
    Mar 19, 2016
    Messages:
    815
    Likes Received:
    876
    Reading List:
    Link
    Regardless of why you want to learn php, you asked for a way to learn php and that I can tell you. Try w3schools.com. While it's more useful and famous for learning sql, it does an okay job for learning the basics of php (and Javascript) as well.
     
    Nom de Plume likes this.
  19. Nom de Plume

    Nom de Plume [Shio’s Disciple] [True Villain] [Equip: Gunblade] Novel Updates Staff

    Joined:
    Oct 20, 2015
    Messages:
    2,693
    Likes Received:
    13,032
    Reading List:
    Link
    :hmm:

    I’m more than half convinced, but this is a lot of options within Javascript. Which would you start with for learning more about the backend, like for making a database? I would say I would prefer an option that works well with the front end as well, but JavaScript already has functionality for that. The little bit of JavaScript I learned was the syntax and such, doing small isolated projects like making a very basic calculator incorporated into a webpage. The last time I really touched JS was 2012, so I’m a bit lost when you start listing things like Vue. Are they compilers? I actually very much enjoyed JS back then, but was under what seems to be a mistaken or at least outdated impression that the language was limited in what it could achieve.

    Also, what happens to a JavaScript based webpage if the user disables JavaScript in their browser? I know, it’s probably a stupid question. :blobfearful:

    Thank you all so much for the very detailed responses. :aww:
     
  20. lnv

    lnv ✪ Well-Known Hypocrite

    Joined:
    Jan 24, 2017
    Messages:
    7,702
    Likes Received:
    9,044
    Reading List:
    Link
    You can use standard SQL databases with javascript(NodeJS) or if you don't want to learn SQL, there are NoSQL databases which have a JSON store or key/value store. If you are writing an application, there is also the built in IndexDB (but this is front end).

    You can still use the old syntax of javascript, or you can use the new ones or both really.

    Vue is a reactive framework (for front end). What a reactive framework means is that you don't refresh the page and things refresh themselves automatically. If you had experience with javascript in the past, when updating fields or divs you had to write events and update on event right? With vue, you simply assign a variable to a field and when that variable is changed, the field automatically updates.

    There are also component frameworks that go on top of vue that include stylized components.

    For example, for my novel I wanted to deal with the hassle of generating pretty stats tables of a litrpg, using quasar(a component framework on top of vue) I made this generator:

    https://codepen.io/anon/pen/odXQaR

    As you notice, when you pick a different value and things change reactively, that is vue. the Material design and functionality of the components themselves is handled by Quasar. All of the data is source fed in by json files loaded in via ajax. If you notice, at no point is anything refreshed


    If you are talking about Backend javascript (NodeJS), nothing happens, it'll work just fine. If you are talking about front end javascript, then it wont work.

    There are 3 ways to go about that:
    1) You can put a noscript tag and ask people to enable javascript - easiest
    2) You can make an alternative website without javascript - medium
    3) You can do SSR, which is server side rendering. (now do note, not all SSR means works without javascript, most SSR would only render the first page to speed things up but still would need javascript, that said you can use SSR to create non-javascript alternative components) - hard
     
    Nom de Plume likes this.