Answer the question
In order to leave comments, you need to log in
Pasting in echo html + php?
It is necessary to make it so that different information is displayed for different users,
for example - if the user is not registered, then one
if registered, then another.
This code displays the html code, which is different for them:
<?php
if ( is_user_logged_in() ) {
echo <<<HTML
<div class="all">Вы зареганы!</div>
HTML;
}
else { echo <<<HTML
<div class="all">Вы не зареганы!</div>
HTML;
}
?>
<?php
if ( is_user_logged_in() ) {
echo <<<HTML
<div class="all"> Вы зареганы!</div>
<div class="end1">
<?php
Код
?>
HTML;
}
else { echo <<<HTML
<div class="all">Вы не зареганы!</div>
<div class="end2">
<?php
Код
?>
HTML;
}
?>
Answer the question
In order to leave comments, you need to log in
<? //тут пых ?>
<!--тут хтмл-->
<? //тут тоже пых ?>
// или так
<?
//тут пых
?>
<!--тут хтмл-->
<?
//тут пых
?>
<?php if ( is_user_logged_in() ):
echo '<div class="all">Вы зареганы!</div>'.
'<div class="end1">'.
my_php_code_here();
else:
echo '<div class="all">Вы не зареганы!</div>'.
'<div class="end2">'.
my_php_code_here();
endif;
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question