Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>HTML is not a programming language. It's a markup language. It simply describes how things should look and be laid out on a webpage.</p> <p>PHP is a programming language, not a markup language. It performs logic and is able to process files and other things.</p> <p>You'll need both, combined, to do what you'd like. And there are plenty of good HTML+PHP tutorials out there to help you. Search google and here for that.</p> <p>This will get you each line in file: <a href="http://www.ibm.com/developerworks/library/os-php-readfiles/" rel="nofollow noreferrer">http://www.ibm.com/developerworks/library/os-php-readfiles/</a></p> <p>After that, it's up to you to format and parse it how you want. I suggest spending some time on php.net (<a href="http://php.net/manual/en/tutorial.php" rel="nofollow noreferrer">http://php.net/manual/en/tutorial.php</a>) or searching google for information. Someone has done what you want, I'm almost positive.</p> <p>EDIT:</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;script&gt; &lt;?php echo "Current version: " . file_get_contents('/version.txt');?&gt;; &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>This doesn't work because it tells PHP to put what ever the contents of version.txt is into the script tags of the page, or more importantly, to put it exactly where you're calling the PHP code from.</p> <p>For it to be displayed, the content that PHP generates in the <code>&lt;?php ?&gt;</code> areas of the code has to be inside of HTML tags that will eventually display.</p> <p>For instance:</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;div&gt; &lt;?php echo "Current version: " . file_get_contents('/version.txt');?&gt;; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Because the HTML tag <code>&lt;script&gt;&lt;/script&gt;</code> is supposed to contain <strong><em>invisible</em></strong> javascript code, whereas the <code>&lt;div&gt;&lt;/div&gt;</code> is a generic tag meant to hold <strong><em>visible</em></strong> content. Your example doesn't work because it's putting all of that output in the invisible parts of the page instead of the visible ones.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload