[SOLVED] Merge the index.html (rather as index.php) with PHP


#1

I need to merge index.html (saved/renamed as index.php) with php/mysql

this is my html.html-file as used in your HTML/CSS examples:

<div >
    <form class="text">
      <legend>
        <h3>
          <div id="title">HTML5 File API</div>
        </h3>
      </legend>
      <fieldset>
          <label for="csvFileInput"> <strong>CSV File:</strong>
          </label>
          <input type="file" id="csvFileInput button" onchange="handleFiles(this.files)"
          accept=".csv">
        </div>
      </fieldset>
         <fieldset2>
          <label for="handleInput"> <strong>Reaktion:</strong>
          </label>
          <button type="button" onclick="window.handleTable();">Click Me!</button>
        </div>
      </fieldset2>
    </form>
    <div id="output" class="outPutTbalesOnly">
    </div>
<button type="button" onclick="saveDynamicDataToFile();">Click to Save</button>
  </div>
  <br>
  <br>
<div id="sum">45</div>

  <!-- Le javascript
    ================================================== -->
  <!-- Placed at the end of the document so the pages load faster -->
  <script type="text/javascript" src="js/read-csv.js"></script>

The exported HTML-file already can consume this CSV-reader to be merged:

<!doctype html>
<html>
<head>
    <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no' />
    <meta charset='utf-8'>
    <link rel="stylesheet" type="text/css" href="styles.css">
    <link rel="manifest" href="manifest.json">
    <style></style>
    <title>DialogueFlower_ND_TVF</title>
    <script src="playcanvas-stable.min.js"></script>
    <script>
        ASSET_PREFIX = "";
        SCRIPT_PREFIX = "";
        SCENE_PATH = "772282.json";
        CONTEXT_OPTIONS = {
            'antialias': true,
            'alpha': false,
            'preserveDrawingBuffer': false,
            'preferWebGl2': true
        };
        SCRIPTS = [ 20728537, 20730293, 20754002, 20754003, 20761731, 20762809, 20762812, 20871808, 20948744 ];
        CONFIG_FILENAME = "config.json";
        INPUT_SETTINGS = {
            useKeyboard: true,
            useMouse: true,
            useGamepads: false,
            useTouch: true
        };
        pc.script.legacy = false;
    </script>
</head>
<body>
    <script src="__start__.js"></script>
    <script src="__loading__.js"></script>
	**<script type="text/javascript" src="js/read-csv.js"></script>**
</body>
</html>

This is how the html.html-file looks like from the/your HTML/CSS example:

<div >
    <form class="text">
      <legend>
        <h3>
          <div id="title">HTML5 File API</div>
        </h3>
      </legend>
      <fieldset>
          <label for="csvFileInput"> <strong>CSV File:</strong>
          </label>
          <input type="file" id="csvFileInput button" onchange="handleFiles(this.files)"
          accept=".csv">
        </div>
      </fieldset>
         <fieldset2>
          <label for="handleInput"> <strong>Reaktion:</strong>
          </label>
          <button type="button" onclick="window.handleTable();">Click Me!</button>
        </div>
      </fieldset2>
    </form>
    <div id="output" class="outPutTbalesOnly">
    </div>
<button type="button" onclick="saveDynamicDataToFile();">Click to Save</button>
  </div>
  <br>
  <br>
<div id="sum">45</div>

  <!-- Le javascript
    ================================================== -->
  <!-- Placed at the end of the document so the pages load faster -->
  <script type="text/javascript" src="js/read-csv.js"></script>

I am thinking about using this approach:


BUT ALL IN ALL: Cannot read the php-part, even if I do this in bottom of html (php):

<body>
    <script src="__start__.js"></script>
    <script src="__loading__.js"></script>
	
		<script type="text/javascript" src="js/read-csv.js"></script>
		<?php
	echo"  test";
	echo"    <table width=\"1200\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"tableIdOevre\">
      <tr>
        <td><input type=\"text\">100000000</td>
        <td><input type=\"text\">100000000</td>
      </tr>
      <tr>
        <td><input type=\"text\">50000000</td>
        <td><input type=\"text\">3000000</td>
      </tr>
    </table>";
	?>
</body>

#2

https://stackoverflow.com/questions/18140270/how-to-write-html-code-inside-php


#3

Most of the times I read your questions, you have a terrible syntax.
Sometimes I even think you must be trolling.
If you manage to improve that, it will save you tons of headaches.

Have you tried using echo "test"; instead of echo" test";?


#4

the syntax mirrors that I am stitching online examples (in a perfect World, I could have time for better syntax in here … yet, present time capitalism wants it otherwise … theory of ever growing complexity etc.)

But that a side, anyway: will try your approach :slight_smile:


#5

Solved it myself by going here: https://developer.playcanvas.com/en/tutorials/loading-json/ and
Convert mysql to json

@Patriboz: And the people of Habermas, stared down from the mountain … at first they tried to take in and understand the brute honesty of Gordon Ramsey,… but could only sigh and turn around …