Home php How to display messages of the Echo view in Div?

How to display messages of the Echo view in Div?

Author

Date

Category

Tell me how to make the echo messages displayed in Div? Thank you in advance! The message is sent by the handler. Below is an example of a script that returns the value.

if ($ inserted_id & gt; 0) {
      Echo "Uploaded File:". $ FileName;
    }

Answer 1, Authority 100%

There are many different methods (two at least exactly there =)). The first is in the banal output of the HTML code into the block to be filled. For example:

& lt; div & gt;
& lt;? php echo ('Text')? & gt;
& lt; / div & gt;

The second way at the same time and convenient and “Nubsky”, but nevertheless it is often used, including me). The way is to output the JavaScript code to any point of the page. Next, Javascript takes care:

somewhere on page:

& lt;? php
$ text = "& lt; b & gt; bob & lt; / b & gt;";
Echo ("& lt; script & gt; $ ('# somediv'). HTML ('$ TEXT') & lt; / script & gt;");
? & gt;

“noordination” of this method is that JavaScript is obtained scattered over the entire page, which is good. It follows from this that somewhere at the bottom of the page you need to highlight a separate section, a block for such inserts of the Yavasipte.


Answer 2, Authority 50%

if ($ inserted_id & gt; 0) {
  Echo "& lt; div & gt; uploaded file:" $ FILENAME. "& lt; / div & gt;";
}

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions