Transcripts
1. Introduction To PHP Course: Welcome everyone to the
complete PHB beginner course. This course consists of different
classes like how to run the PHB program in the Visual Studio code
using XAM Control panel, and also we are going
to discuss about the concepts like variables, data types, conditional
statement, loops. At last, we are going
to discuss about post and get method in PHB. So this course is very, very
useful for the beginners who are trying to learn
PHP for the first time. So let's get started.
2. PHP Class 1 : History Of PHP : Welcome everyone to
the first class. In today's class,
we're going to discuss about introduction to PHB. So PHB is a popular server
side scripting language used for web development. And also, you can see
the full form for PHB. So full form is nothing but
hypertext preprocessor. And then you can see the PHP is designed to be
embedded into HTML. You can embed the PHB
program inside the HTML. Also, the BHB is powerful tool for creating dynamic and
interactive website. So if you want to
create your website to be more responsive, you have to use PHB. So also you can see PHB is
an interpreted language. So it will check the
output line by line. At last, you can
see PHB was created by Rasmus Lardov in 1994. So this is the
introduction to PHB. So after that, we
are going to discuss about advantages of PHB. So the first advantage
is open source. So PHB is an open source, so everyone can access
the PHB source code. And then second one
is easy to learn. So PHB has the same syntax, similar to other
programming languages. So that's why it
is easy to learn. After that, you can see
the third advantage that is flexible scalable. You can use PHB for
building any websites of any size from personal blogs to large scale e
commerce platform. So it is very flexible. You can create small website and also large website using PHP. So these are all the advantages. So after that, we
are going to discuss about disadvantages of PHP. So the first one is the
performance concern. So PHB is very, very slow here. Compared to other
server side languages. So that's the first
disadvantage. It is very slower. After that, you can see
the second disadvantage, that is security
vulnerabilities. So PHP code can be
manipulated by the hackers. So by creating any cross
side descripting attacks, the PHP is very,
very vulnerable. And then you can see
the third disadvantage that is limited modularity. So PHB cannot be used
for very large projects. So that's the
limited modularity. So these are all the
disadvantages of PHB. So after that, we are
going to discuss about the applications that can
be created using PHP. So the first one is the
content management system. For example, the WordPress, it is an content
management system. And then you can see
the E commerce platform like U Commerce Magneto. So these are all
the website that can be created using PHB. After that, you can
see the applications like Facebook, Wikipedia, Yahoo. And then you can see the
services like APA RS, SOP. So these can be
created using PHB. At last, we are going
to discuss about job opportunities
when you learn PHB. So if you learn PHB, you can achieve the jobs
like PHB web developer, PHB Bend developer, and then
PHB, freelance developer. So these are all the
job opportunities you can achieve
when you learn PHB. So that's it, guys.
In today's class, we discussed about the
introduction to PHB. In the upcoming class, we are going to discuss about how to run our first PHP program
in Visual Studio code.
3. PHP Class 2 : Running PHP in VSCode: Welcome everyone to
the first class. In today's class, we are
going to discuss about how to run the BHB program
in our computer. For running the PHB program, there are many IDE. You can use the ID
like net Beams, Visual Studio code,
Eclipse and code Light. I'm going to select Visual Studio code for
running the PHB program, so you need to open the VS code. And then you need to download the VS code for your computer. So you can select Windows. So after that, you
need to download ZAP for running the PHP server. So for that, you need
to type Zam download, and then you need to open
the official website. So in that you have to select the first opson
that is the 64 bit. So after the download
is completed, you need to install the ZA. After that, you need to
open the Zam Control panel. So in that, you need to
start the Apache server. So you need to start
the Apache server. You can see the Apache is
running in your computer. Green shows that there is no error for running
the Apache server. So after that, you need
to open the Windows C, and then you need to
open the ZamFolder. In that you need to
search for HD doc and then you need
to open the folder that is the HHD dogs. So in that you need to create a new folder for running
our PHP program. For that, you need to
type the folder name. I'm going to type PHB. After creating the folder, you need to open that
folder using the VS code. So for that, you need to right click and then you have
to select VS code. So after opening the VS code, you need to create new BHB file. For that, you need to select File Opson and then you
need to type the file name. So you can type
your own file name. I'm going to type
sample dot PHB. So BHB is the extension. So we have successfully
created new file for our PHB. So now we are going to discuss about how to run
our PHP program. So first, you need to type PHB, so that's the starting syntax. And then you need to type echo for printing the
output in the web page. So you need to type Echo
Inside the quotation, you need to type the string. And then you need to put
semicolon to end the statement. So this is the syntax for PHB. So you need to open your
browser for your output. So for that, you need
to open the browser, and then you need
to type local host. You need to type local post, and then you need to type
the folder of your project. So my folder is PHP, so I'm going to type PHP. You need to type
the folder name. So I'm going to type PHB slash, and then the file
name of the PHB. That is sample dot PHB. So after that, you
can see the output is successfully generated
in the webpage. So this is how you can run your PHB program in the
webpage using the ZAP. So that's it guys we are
discussed about how to run our first PHB program in
the web browser using ZAP.
4. PHP Class 3 : Variables: Welcome everyone to
the second class. In today's class,
we are going to discuss about variables in PHB. So variables are
nothing but it is a container which is the data. So that's the simple
definition for variables. So you need to type the
commands inside the PHP tag. Then only the
command is executed. So after that, we are
going to discuss about how to create variables in PHP. For creating the variables, you need to type
the symbol dollar. And then you need to type
the name of the variable. That is name equal to, and then you need
to type the value. That is Run RN is the value. So name is the container, which is the value RN. So this is how you
can create variables. If you want to
print the variable, you have to type
Echo dollar name. So name is nothing
but the variable. So you need to open the
web page for the output. So you can see the output RN
is successfully generated. So this is how you can
create variables in PHP.
5. PHP Class 4 : Datatypes: Welcome, everyone.
In today's class, we are going to discuss
about data types in PHB. So there are many data types, but we are going to discuss
about int flow and string, how to create integer
data type float data type string
data type in PHB. For creating the variables, you need to type
the dollar sign. In PHB, you don't need
to type the data type. It automatically
assigns the data type. Like Python, the PHB also
assigns the data type. So the first one is
the integer data type. Dollar A col to ten is nothing
but integer data type. So after that, we
are going to create the second data
type that is string data type, dollar
CultiveHllo world. Inside the double quotation, you need to type the string. So it is considered
a string data type. And then we are going to create a third data type that is float. So you need to type
dollar C qualtive 20.4. It is nothing but
float data type. So this is how you can
create data types in PHB. You don't need to type
the data types in PHB. It automatically
assigns. So after that, if you want to print
the variables, you have to type Echo. Echo is for printing
the variables. So A is nothing but
integer data type, and you have to type the second, that is dollar B, Dollar B is the string data type and dollar C that is
float data type. So after that, you need to type break command for printing
the output in the new line. For that, you need to
type dot V or tag. So if you don't type BR, the output will generate
in the same line that only have to use BR for creating the output
in the next line. So.br for creating the
output in the next line. So after that, you have to open the web page for your output, so you have to reload, and then you can
see the data types, integer, stream, and float. Oh, so if you want to
find the data type, you can use we dum function. So we dum function will find the data type for your variable. So you have to type we dump off, and then you need to
type the variable. That is A, we are going to
find the A variable data type. So you have to open the website, and then you can see in. So we successfully find the data type using
dumb function. So that's it, everyone.
In today's class, we discussed about
data types in PHP.
6. PHP Class 5 : Arithmetic Operator: Welcome, everyone.
In today's class, we are going to discuss
about operators in PHP. There are many operators. So first, we are going to discuss about
arithmetic operator, so plus minus division multiplation, increment
and decrement. So these are all the
arithmetic operators in PHB. So we are going to
discuss that one by one. First, we are going
to create variables, so dollar A equal to ten
and dollar B qual to five. So these two are
integer variables. And then we are going to
print the output using Echo. You have to type Echo
dollar A plus dollar B. So if you don't type dollar, it will show on error. For that only every time, if you create a variable, you have to type dollar sign. So BR is for creating the
output in the next line. So you have to change
the symbol A minus B, A into B, A divided
by V, a modulo B. So divid gives
quotient as an output, and modulo give
reminder as an output. So A plus plus is nothing
but post increment. So in PHP, we cannot
create pre increment. So if I try to create
pre increment, you can see the error message. So PHB does not
allow pre increment. Only post increment can
be available in the PHB. For that, you need to
change to post decrement. So these are all the
arithmetic operators in PHB. So you need to open the web page and then you have to reload, and then you can see the output. So the first one is Addison,
subraction, multiplation, division, and modulus, and last two post increment
and post decrement. In post increment the
value of A only printed. So that's the difference between post increment and
pre increment. In pre increment,
incremented value will be printed in the output. But in post increment, only value of A will be printed. So after the next line, the value of A will
be incremented. That value will be present in the output of pre decrement. As that is the A becomes lawn, that value will be generated
as an output for decrement. That is post decrement,
A minus minus. So you have to
remember the concept of post decrement
and post increment.
7. PHP Class 6 : IF Else: Welcome, everyone.
In today's class, we are going to discuss about
IFs conditional statements. So I is nothing but
it is a block of codes which can be executed when the
condition is satisfied. So we are going to
see an example for I Fels conditional
statement in PHP. For that, I'm going to
create two variables. First you need to type
dollar A equal to ten. So that's the first variable and then dollar B equal to five. So that's the second variable. And then I'm going to use
I condition inside that, you need to type the condition, dollar A greater than dollar B. So if the condition
is satisfied, then I will be
generated as an output. That is, A is greater than B. So after that, if the if
condition is not satisfied, then ls will be printed. So in else, you can type
A is not greater than B. So if two conditions
are not satisfied, if you want to create
more conditions, you have to type s if so
you have to type el CF. And then you have to
type the condition, dollar A equal to
equal to dollar B. So it is nothing but
A is equal to B. So you need to know
about the LCF syntax. In some of the
programming languages, there can be some
space between LCF. But in PHB there
will be no space. So based on the condition, any one of the block
will be executed. You can see the output,
A is greater than B. Because A value is ten. If I change the value to two in B and try
to run the code, and you can see the output, A is not greater than B. So if I change to ten, you can see the output. A is equal to B. So based on the condition, we can run if s and s if.
8. PHP Class 7 : Switch Case: Welcome, everyone.
In today's class, we are going to discuss
about switch in PHB. It is an alternate to ELs
conditional statement. So switch is also a
conditional statement. So for that, we are
going to see an example. First, I'm going to create
the variable D cltive two. And then you need to type
the syntax of switch. So first you need to
type the keyword switch. Inside the bracket, you
need to type the variable. That is day so after that, you need to type
the curly brackets. Inside the curly brackets, we are going to type cases. So you can create many cases
based on your program. So first, I'm going
to create case one. So if the condition of
case one is satisfied, then the echo will print Monday. And then you need to type break. So if you don't type break, other cases will be
printed in the output. For that only, you
need to type break. So after that, I'm going
to create the second case. So inside that, I'm
going to print Tuesday. And then you need to
type break statement. If the condition is satisfied, then that output
will be printed. Also, you can type
the default case. So default is nothing, but if other cases
are not satisfied, then default will
print the output. So we are going to
print invalid day. Also, you have to type break so this is how you
can create switch in PHP. So this is the syntax. First, we have created
the day value is two. We know that the case
two will be printed in the output because
the value case two is same as the
day value two. You can see the output
in the web page Tuesday. So if I change the value to any other values like one
and try to run the code, you can see the output Monday. So if I time any
other invalid day, then the output of
default will be printed. That is invalid day. So that's it guys
in today's class we discussed about
switch in PHB.
9. PHP Class 8 : While Loop: Welcome, everyone.
In today's class, we are going to discuss
about loops in PHB. So first, we are going to
discuss about wild loop. So loops are very, very important in
programming languages. For example, if I want to print hello world for ten
times for default, I'm going to type
echo hello world, echo hello world for ten times. For this problem, the loops
are introduced in PHB. So loops are based
on some condition. If the condition is satisfied, then the loop will be
executed in the output. So first, we are going to
discuss about the y loop. So using the y loop, we are going to print
halo world for ten times. For that, first,
you need to create the variable using Donner
A equal halo world. So it is considered
a string data type. And then you have to
create the dollar for starting value that
is I equal to one. And then you need to
type the keyword, that is the le, and then you
have to type the condition. The condition is very,
very important in u. So the condition is I less
than ten or equal to ten. Based on your starting value, you can type your condition. So in that you have to
type the dollar sign. If you don't type
the dollar sign, the output will
so error message. So after that, we are going to print the halo world
for ten times. For that, you need to type echo for printing the
Hala world ten times. You have to type echo. So you can also type your string or you can
type your variable. It is your own choice. So I'm going to type the string
BR is nothing but break. It will generate the
output in the new line. So inside the quotation,
you need to type BR. Also, you need to
increment the I value. Then only your output will print hello world for ten times. For that, you need to
type dollar I plus plus. So this is how you can
create wild Loop in PHP. So the condition is I less
than are equal to ten. The value of I is one, one less are equal to ten. The condition is satisfied. Then halo world will be printed. Then the value of I will
be incremented two, two, two less than
are equal to ten. The condition is satisfied. Again, the hala world will
be printed second time. Then the value of I will
be incremented to three, and the condition is three
less than are equal to ten. The condition is satisfied, halo world will be printed
for the third time. Up to ten, the
condition is satisfied. The ten times halo
world will be printed. Then the value of I will
be incremented to Lawn. When the value of I will be an, the condition is not satisfied because an is not less than ten. Then the loop will be exit. So that's the concept
of loops in PHP. So that's the concept of loop
in programming languages. So if I run the code, so you can see the
output in the web page, hello world, halo world
halo world for ten times. So based on the condition, the Hala world is
printed ten times.
10. PHP Class 9 : For Loop: Welcome, everyone.
In today's class, we are going to discuss
about far loop. In previous class, we are
discussed about I loop. So using the far loop, we are going to print
color world for ten times. So first, you need to
type the syntax for far. You have to type the keyword
for inside the bragt, you have to type
the starting value, dollar I equal to zero R one, you can type your
own starting value. And then you have to
type the condition, I less than are equal to ten, and then you have to
type the incrementation. That is I plus plus, dollar I plus plus. So value of I is one. Then the condition is satisfied because I less
than are equal to ten. The condition is satisfied, then the value will be
incremented one by one. So inside the far loop, we are going to print the
halo world for ten times. For that, you need to type Echo, and then you have to
type the halo world. So you can type the
variable itself, or you can type the string. It is your own size. So I'm going to type
the dollar a.br, BR is nothing but it will print the output
in the next line. So if I open the web
page for output, you can see the output as
a printed in ten times. So that's it, guys.
In today's last, we are discussed
about Floop in PHP.
11. PHP Class 10 : Break & Continue: Welcome, everyone. In today's
class we are going to discuss about break
and continue in BHB. So break will exit the loop. Continue will skip the
particular value in the loop. So that's the difference
between break and continue for then we are going to see an example using the far loop. You have to type the syntax. You have to type
the starting value and then condition,
and then increment. So if the value of
I becomes three, then we will exit the
loop using break. So you have to type break and then you have to open
the web page for output. You can see the
output one and two. So if the value of
I becomes three, then we will exit the loop. So I'm going to change to
four and then run the output. You can see one, two, three. So if the value of
I becomes four, then the loop will be
exit using the break. After that, we are going
to discuss about continue. So continue is nothing, but it will skip the loop. So if I run the
code, you can see all the output based on the
condition satisfaction, then the particular four
value will be skipped. So that's it, guys.
In today's class we are discussed about
break and continue. Break will exit the loop, continue will skip the
particular value in the loop.
12. PHP Class 11 : Array: Welcome, everyone.
In today's class, we are going to discuss
about array in PHB. So RA is one of the data type that can store the elements. So for that, we are going to see an example how to
create array in PHB. First, you need to
type the dollar, and then you have to type
the array name that is A, and then you have to
type the keyword array of inside the bracket, you have to type the values. We are going to create
integer data type array. So this is how you can
create array in PHB. So this is the syntax. Array, you need to type
the keyword array. So after that, we are
going to discuss about how to create array for
dissimilar data type. First, we are going
to create integer, and then we are going to
create string that is hello 20.5. So that's the float. So it is nothing but dissimilar. Data type array, different
data type element. So array is based on
the index concept. So if you want to access
any elements in the array, you have to know about
the index concept. So index start from zero and then goes up
to the element value. So ten is the zero index, is the first, that
is the second. Also, ten is the zeroth index, hello is the first and
20.5 is the third. So if I want to print ten
in the array integer array, you have to type the index
position in the ECO. So you have to
type Echo dollar A of index position, that is zero. So you have to
open the web page, you can see the output ten. So this is how you can print the single element in the array. So if I want to print 30, you have to type the index
position, that is two. So you can see the output 30. Also, you can access the
value of second array. You have to type the
index position one. So if I run the code, you can see the output hello. So if you want to print all
the elements in the array, you have to use loops. For that, we are going
to use the far loop. First, you need to type the starting value
I equal to zero. And then you have to
type the condition, that is I less than or equal
to A and then increment. So inside the far loop, we can print the output
using dollar A of dollar I. It will print the
element one by one. So in BHP, if you want to print all the elements
in the array, you have to use
the funten count. So you have to type I less than R ecult count of dollar A. Then only the output
will be printed in PHP, so you have to run the code. So you can see ten, 20, 30. So you can see the warning sign. If you want to remove
the warning sign, you have to change
the condition. So you have to change
the condition. I less than are equal to two, I less than equal to count. You can see the
warning is removed. So that's it, guys.
In today's class we discussed about RA in PHB.
13. PHP Class 12 : POST Vs GET Method: Welcome, everyone. In today's class we are
going to discuss about the differences between
post and get method in PHP. So first, we are going
to discuss about post. So if you want to
add any new element or update any new
element in the form, you have to use post method. Also, it is very secure. So it is very secure
than get method. And then, second,
that is G. G is useful for if you want to fetch
any values from the form, you have to use get method. Also, G is very, very less secure than post. So we are going to
see an example. For that, we are going to create new file that is
index dot HTML file. So in that, you have to
type HHTML colon five, it will print the
default tax for you, so you don't need to
type the default tag. So inside the body tag, we are going to create form. For that, you have to type the Form tank and
then you have to type x for x and you have to type
the name of the PHP file, that is sample dot PHB. And then you have
to type the method. First, we are going to
discuss about post method for updating or adding
any new values. So inside the form, we are going to
create paragraph, so you can type name. That's your own choice. Colon input. So we are going to type
the input type that is text So if you want
to type any name, it will be considered as text. After that, we are going to
create the second paragraph. That is gender. You can
type your own form. So for basic, I'm just
creating two paragraph. For basic only, I have created two paragraph name and gender. After that, I'm going
to print summit button. So you have to type input type
equal to button or summit, you can type summit so you
have to type the value, so value will be summit, or you can type your own value. I'm going to type summit. So this is how you
can create form in HHTML so you have
to type the form. Inside that, you have
to type the PHP five, and then you have to
type the method that is post method for
adding the values. So the values are
name and gender. So we are just created two
paragraph name and gender. The type will be text, and then you need to
type the summit button. So in the PHP, you have to type the
code for post method. So you have to create
echo and then you need to type the dollar
dollar underscore, and then you need to type
the method that is post. After that, you need to
type square bracket. Inside that, you need to create
name for the input type. So you have to type the
name for the input type. That name will be
useful for the post. Also, you have to type the
name value for gender also. So you have to copy that, and then you have to paste
inside the quotation. And then you need to type.br. BR is for printing the
next output the new line. So this is for the first
name that is the name, and then you have to copy the gender name and paste
that inside the quotation. So we just created post for
two values, name and gender. See how to open the file, you saw how to open the
index dot HTML five, so you have to type Local
PHP and then index dot HT. So you can see the
form, you have to type the name and then gender male. And then you have to type Sumit. So you can see the PHP
five, sample dot PHB. So in that, you can see
the output, Run and male. Also, in the URL, you can see there is
no value present. There is no value like Run and male because the PHP
post is very, very, very secure than PHB
G. So after that, we are going to
discuss about get method for that you need to
change the method to get. So you have to type so
other quotes are same, and then you need to
change the post to get. You have to type
G. So after that, you need to open the browser, and then you have to open
the index dot HTML file. And then you have
to type the name. And then you have
to type gender. So after that, you
have to type summit. So you can see the output. But in the URL, you can see
the value like Run and male. So that's why G is very, very, less secure than post
method. So that's it guys. In today's class, we
are discussed about post and get method in PHB. So post is useful for updating or adding any
values in the form, and it is very, very
secure than get method. And G is useful for fetching
the output and is also very less secure because the value will be
presented in the URL.