Code: Select all
<?php
$randomtext = "This is a random text";
?>
<div>
<h3>Header: <?php $randomtext ?> </h3>
</div>
Thanks in advance.
Moderator: General Moderators
Code: Select all
<?php
$randomtext = "This is a random text";
?>
<div>
<h3>Header: <?php $randomtext ?> </h3>
</div>
First offFacJoe wrote:$randomtext = "This is a random text";
I tried executing this, the variable "$randomheader"'s value does not show up.Code: Select all
<div> <h3>Header: <?php $randomtext php> </h3> </div>
Thanks in advance.
Code: Select all
<h3>Header: <?php $randomtext php> </h3>
Change to:
<h3>Header: <?php echo $randomtext; ?> </h3>Sir,First offSecond off, do you actually have some function to create this so call "random text", and if so, is it storing to the variable $randomtext before this specific set of code?Code: Select all
<h3>Header: <?php $randomtext php> </h3> Change to: <h3>Header: <?php echo $randomtext; ?> </h3>
Note: please post code like this
<code=php>line 1
line 2
line 3</code>
It removes the extra lines at the beginning and end and colors it properly. (make sure you use square brackets)