U
U
user_s2014-11-20 03:23:36
PHP
user_s, 2014-11-20 03:23:36

How to implement such cnc?

I climbed on Yandex, found a couple of articles, but this is not it.
I would like to see by type:
site / category name / sub-category
site / page / 1
site / page / 3
site / page something else / 3
site / search? search text
site / article title (any text)

I understand what needs to be created base with 3 columns

id |ссылка |чпу_ссылка | там еще какие-то параметры
1  |$link  |name_link  | ...

Now the handler or something like that, I actually don’t know what and how.
Well, the conclusion..
id |cat_id |url                  |name
1  |00001  |тут реальная ссылка? |кошка
2  |00004  |тут реальная ссылка? |песок

Connecting to the database-> data substitution ..
Actually something like this:
<?php
  $result_set = $mysqli->query("SELECT * FROM `table` WHERE `id` < 10");
?>

and the output should be something like this
<a href="$cat_id1/$name1">$name1</a>
<a href="$cat_id2/$name2">$name2</a>
... итд до 10)

and in the line where the url should be there should be a site / well, a link as above.
And all this should work on nginx, because it chews better than Apache .. but maybe I'm wrong

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2014-11-20
@user_s

(hellish example)
Use a router and form links in a module, not in a template.
The template is used to display PREPARED data.
(example)
Login from router: [rel.directory]/search?s=abracadabra
Module: $data = [sql fetch abracadabra]
$link=[rel.directory]/$data['col1']/$data['col2 ']/$data['col3']
Template: $link output

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question