Put label that is printed in PHP inside a div

0

I want to show a record of my database. I used PHP to create, insert, and select. The problem is that when I show a record, it does echo within a div which is a Pop-up. The PHP code is within div Pop-up.

Example:

function select($dir, $base){
  ...
  echo "<br><label><b>$affiche[title]</b></label><br>"

}

 if(isset($_POST['insert']))//code is good here!
            {

               select($dir, $base); //affiche évènements 
            } 

And the html code:

<div id='abc' style="display:none"> </div>

    <div id="popup" style="display:none">

        <form method="POST" action="#">
           <input type=submit required  name='insert'>  
        </form>
    </div>
</body>

How do I show out of div ?

    
asked by anonymous 24.10.2014 / 17:14

1 answer

1

You do not need to echo, do so:

$div = "seutexto";

After you already have the value of the variable you can use it anywhere within the HTML (Since it is after the variable has taken the value) using the tag:

<?= $div ?>

You can put this tag outside of your div by pointing to the variable.

See this topic here > for better resolution.

    
27.10.2014 / 15:25