K
K
Kostya007232016-08-12 17:17:29
Network administration
Kostya00723, 2016-08-12 17:17:29

How to implement the formation of html code from script conditions?

The essence of this is
let's say there is a code

<?test?>Text1<?else?>Text2<?/test?>

and the php code should cut out the option that is unnecessary, let's say "Text1" should remain, then
<?else?>Text2
should be cut out.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
DarkMatter, 2016-04-25
@Xokup

1) Yes you can, it's free. transfer the database, files, change the ns domain and you are all on a different hosting, just buy the domain yourself and not through the hoster
2) You need OpenServer on it, install everything on your PC, then transfer the database and files to the hosting.

M
Muhammad, 2016-08-12
@muhammad_97

Example:
views/index.php :

<?php if (condition): ?>
    Текст1
<?php else: ?>
    Текст2
<?php endif; ?>

X
xmoonlight, 2016-08-12
@xmoonlight

We write to the HTML template (example):

<?=if($a>0)?"переменная больше нуля":"переменная не больше нуля"?>

N
nelolka, 2016-08-12
@nelolka

Do you need to parse the text of the kind you've given by running pseudocode, or just puff conditions?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question