I want to print a random sentence everywhere the page is loaded, this is very simple, I know but I'm a very noob with php, can anyone help me?
I tried to to print the html with echo function but it didn't worked.
<?php $r = rand(1,3); ?>
<?php if ($r==1){ ?>
<div class="message">
<font color="00FF22"><span class="textData" data-to-animate='[" This site as been hacked!" , " We are sorr" , " Which of these tool u want to use?"]'></span></font>
</div>
<?php } ?>
<?php elseif ($r==2){ ?>
<div class="message">
<font color="00FF22"><span class="textData" data-to-animate='[" This site is next to be closed." , " We are sorr" , " Which of these tool u want to use?"]'></span></font>
</div>
<?php } ?>
<?php elseif ($r==3){ ?>
<div class="message">
<font color="00FF22"><span class="textData" data-to-animate='[" The monkeys destroyed the server." , " We are sorr" , " Which of these tool u want to use?"]'></span></font>
</div>
<?php } ?>
I get a blank page.
Aucun commentaire:
Enregistrer un commentaire