PHP Tutorial 2 – Servers, Clients, and How the Internet Works

Hey guys welcome back to your second PHP
tutorial and in this post
I want to talk a little bit more about how websites work so we can start programming in PHP alright so first PHP used to stand for personal home page
but as it adapted they change that it is now PHP hypertext processor just so you know so the first P actually stands for PHP which is kind of weird oh yeah

PHP hypertext processor if you don’t even know what that means don’t even worry about it we’ll be getting into it so PHP is what is known as a server-side
scripting language or server-side programming language or just server-side so there’s two options we have server-side and then we have Y side all
right so what does this mean well we have to define what’s a server and what is a client a client is a person who accesses let’s say a website a server is what stores that website so basically it
can be a computer or just a a tower with hard drives and so forth but basically a person who’s on a computer so this is a computer right here we have this guy who’s accessing it he wants to visit

Caleb currycomb for example he types it in at the top and then it goes to the server that has Caleb curry coms content on it and everybody requests that
information and it gets sent back to the computer so now his computer is accessing Caleb curry com
I mean I’m simplifying it but pretty much is how it works right so the content that is sent to him is

client-side content the stuff that stays on the server is the server-side content for example the database which may just be tables with columns and rows I mean visually that is going to stay on the server and it’s not going to cross this line this is because that’s a really crappy lines like anyways we don’t want the client to be able to access the database if he could cross over that line well then he could change all this
content and screw up the website on the server which is going to send improper content to the clients that you’re trying to either provide stuff for them or get some money from them or whatever your website is for it’s going to mess it up so we don’t want him to allow we
don’t want to allow him to get access to the server to the database within the server so all this is stored within the server and we don’t want people to access server content usually sometimes

that may be appropriate for example if you have a user registration on your website and somebody wants to changetheir password
well that password which you can represent with those little astrick things let’s say is passwords four characters long and he doesn’t think
that’s long enough well you may want to take this replace it with something else and put that in the database so next time he tries to login it will look for
the new password rather than the old password well that is something you can do but you’re going to need a server-side programming language such as PHP so we can use this tunnel
and PHP can allow him to change that content within the database and then it can send it back if needed to the client

So this PHP acts like a tunnel between the stuff on the server and the stuff on the clients side so the website HTML and
the forms and stuff that’s all over here but the database content that’s overhere this acts as a tunnel to where they can change things but PHP is going to
check oh are they changing what they really are trying to change or are they trying to trick this website and hack it or update content that they’re not
supposed to update or what exactly are they trying to do by writing this this stuff and asking PHP to change something on the server that that’s dangerous
so we need a a guardian to protect our server because if we just let anybody go onto the server well that’s not going to be so good so all this stuff is kept on
the server basically the place that keeps all your website content in your databases and then we’re going to use PHP which is to start and just look like
a mess to communicate between the two so that’s pretty awesome what how exactly does that work well PHP code is also
stored on the server so we can have PHP code let’s say this is a program right here and it’s a PHP program
right and that right there is how to open PHP we’ll get into that later so this PHP program is on the server and what PHP can do is it can take content
within the PHP code just specific pieces and it can send it over to the client side just what you want so all the rest
of the PHP code is kept within the PHP script on the server so as I’m saying some of its on the server and some of it is sent to the client a way we can do
that is by saying like print hello this right here hello is going to be sent into the HTML source code the content they get with a long within the website that they’re looking at
I’m sorry but the rest of the code they’re not going to get the print this stays within the PHP code and is permanently on the server this wall this is not
going to become this is not going to be over here so some of the PHP code can send content to the client and some of it can be on the server so PHP code is said to be a server-side scripting
language or a server-side language doesn’t really matter so that is pretty much how PHP works to contact a server it allows specific pieces to be sent to
the client or so or stuff sent from the client can be used through a PHP script to communicate with the databases or other content within the server so
that’s all I have to say in this post hopefully I covered it all and I’ll see you in the next one so thank you

PHP Tutorial-1

Thanks for reading this whole article. We hope your result will be outstanding So that your family will be delighted. Keep in touch with EduTec BD and we will give you the right information.

For any information, you want to know the comment below we will provide you as soon as possible.

Join us on our Facebook Page: EduTech BD

Join us on our Facebook Group:  EduTech BD