A
A
Alexey Vesnin2017-09-30 17:17:31
CMS
Alexey Vesnin, 2017-09-30 17:17:31

Is it possible to do this and to what extent it will be correct ???

Hello!
I'm trying to write my own CMS, for the first time, so don't kick me too hard. What is the point, I want to do this:
1. Main page in the form of a Landing Page
2. There will be more regular pages
3. Articles
A question about the Landing Page, I want to make a BLOCKS section in the admin panel.
and add, edit, delete the Landing Page blocks themselves in them.
I plan to display these blocks on the site simply by sorting through the array.
The question is: Is it correct to do so? Store HTML code in database? + Will there still be PHP checks for the presence of a mobile version and GET parameters in these blocks?
---------------------------------
I just want to make sure that everything can be quickly edited through the admin panel...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tom Nolane, 2017-09-30
@tomnolane

I don't think it's a good choice. I did not create CMS'ki. But at one time I used wordpress and joomla (then I refused to use them).
I explain why the idea is not successful: your block can have 5000 lines of code. This bunch of textual information that is stored in the database + the problem will be with SQL injections, because it will not be possible to screen the input data (or it is too hemorrhoids to add all this).
Maybe it's easier - to store (conditionally) the block id in the database. For example, if id = 1 is selected, then the example.php file with this code is loaded in the Landing Page. If id = 2, then example2.php. And you need to edit directly in the php file itself ... it seems that most CMS work like this .... I don’t think there is a better option ...
html code needs to be stored in files, not in the database

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question