How to learn about web development

I wrote an Access database about 18 years ago for the data entry of client data. Now I want to develop a web data entry system, so the clients can enter their own data. I have 45 years of traditional programming and Access experience. But I find developing for the web, very different. Can anyone suggest how I can go about learning how the web pieces work together, preferably with examples and how a framework is used. At some point, I'd be happy to pay for teaching, mentoring and support, but in the end I want to be able to support it myself. The application is very simple. There are over 100 clients to support; a few thousand records a month in total; monthly invoicing. It was suggested that I develop with PHP, MySQL and Javascript. I saw a course with Expert Exchange for using CakePHP, so I thought that I would start with that and see where to go after that.
Tom LobbAccess database developerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gr8gonzoConsultantCommented:
I'm not really a fan of CakePHP (it's pretty slow), but this is one of those things where everybody has their own opinion. Nowadays, Laravel is the go-to framework for most developers who want to use a PHP framework.

As far as learning goes, SitePoint is a pretty good resource:
https://www.sitepoint.com/php/

...but I might suggest just picking up a dummy's guide at the local library or book store, if you're brand-new to this area.

At a really, really high level (and I'm going back to basics - don't be offended), it goes like this:

At its most basic, web pages are just files that have HTML code in them. That HTML code is simply a bunch of instructions that tell a browser application like Internet Explorer, Firefox, or Chrome how to display a page.

It's the same idea as a .doc or .docx file containing instructions that tell Microsoft Word how to display a document.

When we talk about servers, there are "physical" servers that have memory and disk space and all that. However, a lot of people also use the word "server" to refer to a special kind of application that sits on a physical server. These programs might also go by terms like "daemons", "services", "web server", etc... I'll use "web server" going forward to refer to these programs.

The purpose of a web server is to simply sit there, doing nothing except listening to the network. When a request comes in through the network to these web servers, the web server looks at the request and finds the corresponding HTML file, and then sends that file back to the computer that asked for it. That's it.

I've already stated that a browser knows how to turn HTML code into something visible on the screen (a process called "rendering"), but a browser also has the secondary function of making requests to those web servers via URLs. A URL is just an address for a specific page on a specific physical server. So when you load up Chrome and hit the Google home page, Chrome is creating and sending a request to the Google web server, asking for the HTML code for the home page. Once it gets the HTML back, it renders the page on the screen.

Rinse and repeat, and you have the bare-bones basics.

Now, HTML by itself is static. When you create a web page that says, "Hello world", then that's all it will ever say. So when we want to make web pages dynamic, we can use some additional technologies such as Javascript, CSS, and/or PHP.

Javascript is like a mini-programming language that is built directly into each browser. The Javascript code is actually put into the middle of the HTML page, and AFTER a browser gets the response back from the web server and is rendering that page, it can see the Javascript and then pass all that Javascript code over to its built-in Javascript engine in order to run it. The point of Javascript is that it can manipulate a page AFTER the page has been loaded and rendered. So you could have a little bit of Javascript that changes "Hello world" to "Hi there" after waiting for 5 seconds or after the user clicks on a button or something.

The Javascript is not permanently changing the page - it is simply working on a copy of it. There's a lot of power within Javascript. You can even use Javascript to tell the browser to make another request for another web page WITHOUT leaving the current page, and then it could inject that other web page INTO the web page you're already looking at. This technique of having Javascript make calls to other web resources without leaving the current page is called AJAX.

CSS is mostly about adding visual style to your page. It does have some dynamic elements to it, but for now, just consider it a way to make the page pretty. Like Javascript, the CSS code sits within the HTML page itself, and the browser has a CSS engine that understands how to "speak" in CSS and take a line of CSS code and make a button red, for example.

Since Javascript and CSS can get kinda big after a while, a lot of people will put those things into their own files, and then simply have the HTML "point" to those files. The browser knows how to take that pointer and automatically go request those files from the web server, too.

So far, so good, but we're still at a point where we're dealing with mostly static content. Javascript, HTML, and CSS don't really have the functionality to connect to and work with a database.

That's where a scripting language like PHP comes into the picture.

PHP usually acts like a plugin to the web server. When someone asks for a web page that ends in .php, the web server will say, "Okay, this is not JUST an HTML page - it's a PHP page!" It then passes that PHP file request over to the PHP engine / plugin. The PHP file is actually an HTML file that has PHP code added into it, just like Javascript.

The PHP engine then opens up that PHP file and looks through it and looks for any PHP code. If it finds any PHP code, then it processes that code right then and there. It then REPLACES the PHP code with the OUTPUT of that code, and then takes the final output, and then returns that output as if it was really like that all along.

So what the browser gets back is just that final HTML - it doesn't see any PHP code and cannot tell what parts of the file were regular HTML and which parts were PHP.

For example, a PHP file might look like this:
<html>
<body>
This is HTML here. The result of 2 + 2 is
<?php
echo 2+2;
?>
</body>
</html>


When a browser asks a web server for that PHP file, it will get back this:
<html>
<body>
This is HTML here. The result of 2 + 2 is
4</body>
</html>


So PHP is very powerful in that it can dynamically generate HTML files, and it does it really quickly.

It also is a pretty full-featured language, so it has the ability to connect to a database, run queries, and so on. It can then take the results of those queries and generate some HTML to display the results, which is how a browser can request a web page that displays data from a database. PHP is the middle-man / butler that is obeying the PHP code that goes and runs the queries, and it generates HTML output on-the-fly.

And since PHP runs on the server, it means that browser doesn't need to have anything special installed. The browser simply sees HTML coming back from the web server.

It can take some time to build a secure, well-built application in PHP. While you can whip out some code pretty quickly and do a lot in just a few lines, it doesn't mean that it's the RIGHT way to do it. A lot of new PHP developers end up creating web applications that are vulnerable to hacking or abuse. So PHP frameworks are simply libraries of code that you can download and they come with a bunch of well-built code already. So instead of reinventing the wheel a dozen times, you can just make use of the framework's code whenever it applies to your needs.

And that's pretty much the 50,000-foot view of how it all sort of works together. And in this little corner of the development world, there are a dozen ways to do everything, so someone could easily come through here and take any number of my above claims and say, "Yeah, but it's not always like that." As you gain experience, you'll figure out all those exceptions/ways of developing.

Again, I'd strongly recommend buying a book and following through its examples to get your feet wet. A good book will walk you installing all the different pieces like Apache (web server), PHP, MySQL, setting up a database, setting up the code to connect and query, etc...
5

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
CakePHP... shudder...

Go setup a KimSufi server ($5-$30/month) for a fast + dedicated server.

Install Ubuntu Bionic + a LAMP Stack.

Then teach yourself WordPress. Stick with GeneratePress (theme) + Beaver (page builder).

If you run your own dedicated server, as a side effect you'll also learn about system admin.

Become a WordPress + LAMP Stack Guru + you'll be amazed about all the ways you can generate cash.
0
Chris StanyonWebDevCommented:
@gr8gonzo has pretty much summed up the overall general approach to Web Development ( take issue with "The PHP file is actually an HTML file that has PHP code added" !! ), and from his comments, you should be able to see how the different parts work together. It's absolutely essential that you understand that - how all the moving parts interact with each other.

If you allready understand another programming language, then learning PHP will be a little easier, but you will need to setup a development environment. Unlike HTML, you can't just open a PHP file in your browser - it needs to be served. The most common approach to a development environment is called a LAMP stack, which stands for Linux / Apache / MySQL / PHP. Linux is the operating system so the stack can also be called WAMP (Windows) or MAMP (Mac). Apache is the actual Web Server (sometimes nginx is used instead). MySQL is the database Server (sometimes MariaDB), and PHP is the scripting language.

If you're on Windows, and just starting out learning, then simply install something like WAMP Server. It's a simple download and install and it'll give you a full WAMP stack. It's not ideal for a production-level application, but it is a quick and easy starting point, and you don't have to worry about sysadmin work at the moment - that'll come later. If you want to dive straight into a production-level environment, you can set up your own virtual server using a Vagrant box. This will give you the full Linux OS inside a virtual machine so there's no external services to subscrive to. You can learn sysadmin in the comfort of not worrying about breaking it.

Once you've got your DevEnv setup, you can start playing around in your sandbox. Write a simple "Hello World" app (all developers do it !), and build from there. Ask lots of questions. Learn about Variables / Functions / Arrays etc. These are basic building blocks of ALL programming languages. Learn how data is sent from the users browser to the server (start with simple GET and POST requests), and understand how PHP can interact with them.

Learn about the Database libraries available within PHP (the big 2 are mysqli and PDO - I would highly recommend PDO), and start writing a simple script that can take the user entered data in a POST request and INSERT it into your Database.

These are all fundamental concepts that you will need to get your head around.

If you're looking to write a data driven application, then you'll also need to do some work in learning about Database design. This isn't specific to Mysql, PHP or Web Development. It's a general concept that will help you to create a well-designed, scalable Database.

I would generally suggest you don't look at the framework's until you at least have a reasonable understanding of the basics. There are a few good ones around (Laravel / CodeIgniter / CakePHP etc) and they all do things in their own way, so until you know enough to choose one, you're better off starying away. In the long run, a framework can help you build bigger and better applications, but without that basic understanding, it will probably feel like really hard work.
2
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

gr8gonzoConsultantCommented:
take issue with "The PHP file is actually an HTML file that has PHP code added"
Yep, I figure people would take issue with various claims, but I was trying to approach it from how a new developer might perceive it, so there's a lot of over-simplifications and slight inaccuracies in there for the sake of keeping it simple for the OP. -shrug-

If you run your own dedicated server, as a side effect you'll also learn about system admin.
System admin should never be something you learn about as a "side effect." That's like saying that if you learn about building a car stereo and you build out a car with it, then you'll learn about how to build a car as a "side effect." I strongly recommend against trying to set up a dedicated server and learning sysadmin work if you're just learning how to write PHP code. Learn to crawl before you try to run. Learning how to be a system admin should be something that takes full focus - otherwise you're liable to set up a server that will perform terribly or get hijacked.

Then teach yourself WordPress
Again, I disagree here. WordPress is a really popular application and it has some great uses. Trying to convert it into an invoice / data entry application is like buying a computer so that you can empty it out, fill it with water, and use it as a fish aquarium. There's a lot of functionality within WordPress, and if you're not using it for what it's meant for, then you're incurring a huge amount of overhead and vulnerability (it's popular, so it's also a popular hacking target) for no good reason.

Plus, you'd be learning how to write PHP that is specifically meant for WordPress, so it would start silo-ing your development skills.

If you want to later get into general consulting work, then David's advice is good, but it's not really the appropriate approach for developing your data entry / invoicing application.
1
Tom LobbAccess database developerAuthor Commented:
I appreciate all the input, thanks. When I said that the application is simple, this means no blogging, audio, video, YouTube, graphics, etc. (at least to start with and maybe for the first few versions). This may be the only web application that I'll ever write, so I likely won't have my own server. I plan to restrict the web data entry site to our clients and perhaps have something totally separate for marketing our application to the single occupation that could make use of it. I expect that eventually I would write all the code (HTML, PHP, JavaScript, CSS and anything else) directly. But in the beginning, if there are any code generators or other tools to help me learn, I'd at least consider them.

One suggestion that I found particularly helpful, was to not start with a framework. I use a Mac, so I thought that I would install MAMP, unless there's a compelling reason to use something else. So I need to learn how to set it up and use it. My comment about CakePHP, was solely to take the Expert Exchange course. If switching to something else like Laravel afterwards isn't difficult, I'm good to do that.

Thanks again to all of you.
0
Tom LobbAccess database developerAuthor Commented:
All input was valuable. Thank you for making yourselves available in support of learners like myself.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Something different to think about if your goal is to set up a data entry system where there may be a simple search and perhaps some user roles would be to use a low-code application like Google App Maker https://developers.google.com/appmaker/ or Appian https://www.appian.com/platform/low-code/ or outsystems https://www.outsystems.com/

If you are just starting out with a web app, you do need to understand both the front end (HMTL, CSS, JS), the back end (in this case PHP) and the database. Having a good background like yours will make coding the backend easier because logic will be similar, but there are still a lot of gotcha's that you learn along the way.

Trying out the low code options will get you up and running quickly and without having to learn front end code or idiosyncrasies of php (or .NET or other language).
1
Tom LobbAccess database developerAuthor Commented:
I've never heard of low-code applications, so this is timely. After a brief search, OutSystems looks like it might be a good one to try. No matter what I use though, I want to be able to switch to doing all my own coding. I haven't found anything yet that talks about that. Also, the costs aren't obvious. This was a great suggestion.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.