0

wordpress プラグインを作成していますが、このコードの段落に少し問題があります。何らかの理由で

echo "<table style='border:solid 1px #000000;'>
  <tr>
    <td style='border:solid 1px #000000;'>Total Submission Sites</td>
    <td style='border:solid 1px #000000;'>Server Status</td>
    <td style='border:solid 1px #000000;'>Plugin Version</td>
    <td style='border:solid 1px #000000;'>Latest Update</td>
  </tr>
  <tr>
    <td style='border:solid 1px #000000;'>test</td>
    <td style='border:solid 1px #000000;'>test</td>
    <td style='border:solid 1px #000000;'>test</td>
    <td style='border:solid 1px #000000;'> <?php require_once('http://wert.in/pluginfiles/files/v101/v101.php') ?></td>
  </tr>
</table>";
4

2 に答える 2

1

なぜ文字列全体をエコーし​​、それなしではなく、<?php require_once( [.....] ); ?>

<table style='border:solid 1px #000000;'>
  <tr>
    <td style='border:solid 1px #000000;'>Total Submission Sites</td>
    <td style='border:solid 1px #000000;'>Server Status</td>
    <td style='border:solid 1px #000000;'>Plugin Version</td>
    <td style='border:solid 1px #000000;'>Latest Update</td>
  </tr>
  <tr>
    <td style='border:solid 1px #000000;'>test</td>
    <td style='border:solid 1px #000000;'>test</td>
    <td style='border:solid 1px #000000;'>test</td>
    <td style='border:solid 1px #000000;'><?php require_once('./pluginfiles/files/v101/v101.php') ?></td>
  </tr>
</table>
于 2011-02-03T14:09:36.870 に答える
1

require を echo に入れないでください。そうしないと、テキストを表示するだけで、関数を解析しません。エコーを "; で終了してから、require で終了し、再度出力する必要があります。または、echo "something" . require(blah) . "end"; を使用できますが、簡単にするためにこれを使用しませんでした。また、 The require uses a local path/file not remote. これは、代わりにハード ドライブで何かを探しているときに、コンピューターのメモ帳で URL を開こうとするのと同じです。

// start the echo
echo "<table style='border:solid 1px #000000;'>
  <tr>
    <td style='border:solid 1px #000000;'>Total Submission Sites</td>
    <td style='border:solid 1px #000000;'>Server Status</td>
    <td style='border:solid 1px #000000;'>Plugin Version</td>
    <td style='border:solid 1px #000000;'>Latest Update</td>
  </tr>
  <tr>
    <td style='border:solid 1px #000000;'>test</td>
    <td style='border:solid 1px #000000;'>test</td>
    <td style='border:solid 1px #000000;'>test</td>
    <td style='border:solid 1px #000000;'>";

// Still using php, dont need the opening tag. 
require_once('http://wert.in/pluginfiles/files/v101/v101.php');

// Finish the echo
echo "</td>
  </tr>
</table>";
于 2011-02-03T14:08:05.113 に答える