filmov
tv
AJAX - Comment Box with [ Javascript jQuery JSON PHP MySQL ] - Step by Step How to Guide - Part 6

Показать описание
In this video we start to do a bit of house keeping and clean the code up, so as that the html file is not full of data.
Basically we use the php require_once function to extract the comment box data and then place it in a seperate file.
This data is then inserted using php. It means also that we do not have to have repetative code within our file.
If you dont understand this part, then dont worry as we will explain it further on the tutorials. Also I have many other videos that explain sections of the code which we have done. I would advise watching some other videos to be able to understand the php as little better.
If you are new to php, then its always going to be hard in the beginning, dont panic, every one has the same problems.
I also introduce you to the other php build in function of define, here we define folder locations in one constant, this helps you out later if you decide to change where the files are keep. Once you have changed the file location all you then have to do is to change the constant once and all of the other variables will still work. If you do not use this method, then you can find yourself searching through every file changing any require_once path to be correct once again.
PHP is about using business logic and keeping the code as flexible as possible although at the same time robust.
Have fun.
Basically we use the php require_once function to extract the comment box data and then place it in a seperate file.
This data is then inserted using php. It means also that we do not have to have repetative code within our file.
If you dont understand this part, then dont worry as we will explain it further on the tutorials. Also I have many other videos that explain sections of the code which we have done. I would advise watching some other videos to be able to understand the php as little better.
If you are new to php, then its always going to be hard in the beginning, dont panic, every one has the same problems.
I also introduce you to the other php build in function of define, here we define folder locations in one constant, this helps you out later if you decide to change where the files are keep. Once you have changed the file location all you then have to do is to change the constant once and all of the other variables will still work. If you do not use this method, then you can find yourself searching through every file changing any require_once path to be correct once again.
PHP is about using business logic and keeping the code as flexible as possible although at the same time robust.
Have fun.
Комментарии