使用PHP时省略HTML的一部分


Omit part of an HTML while using PHP

我正在尝试将目标URL($URL)的一部分加载到我的HTML页面中,目前$URL页面会发回一个名称、型号、类型和自重新计算工具,所有这些都存在于HTML TR标记中。

一旦我从password.php发布了我的每日密码,我的用户就会再次点击$url从中获取他们的每日库存,我并不想成为多余的,但$url本身是由我的客户提供给我的,我不希望我的用户能够看到该页面上的所有链接-只查看与他们的工作相关的链接。

另外,除了我创建password.php之外,还有没有一种方法可以让我从我的每日outlook exchange电子邮件中"收集"这个密码,并将其发布到$url的头部??

许多thx,我希望我是描述性的。

<html>
    <head>
        <title>Post Password</title>
    </head>
    <body>
            <?php
            $password = "";
            ?>
            <form name="password" method="post" action="users.php">
              <table border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td>Paste the Daily Password</td>
              <td><input type="text" maxlength=7 name="password"></td>
            </tr>
            <tr>
              <td><input type="submit" value="Submit"></td>
            </tr>
              </table>
                </form>
    </body>
</html>


<html>
    <head>
        <title>First Page</title>
    </head>
    <body>
            <?php 
            $url_append = "?secret=";
            //$psk = $password;
            $linktext = "Click here to get a Pre Shared Key";
            $password = $_POST["password"];

            $url = "http://example.subexample.xx.com/";
            $url .= $url_append;
            $url .= $password;
            $final_url = $url;
            // end base users
            ?>
<!--I took this form below from the URL that my client host-->
<!--His url have way more input than all_products-->
<!-- but that's the only one that I want to echo for my employees to use -->
<form name="form1" method="post" action="<?php echo htmlspecialchars($final_url);?>">
              <table border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td>Main Inventory</td>
              <td><input type="text" maxlength=7 name="all_products"></td>
            </tr>
            <tr>
              <td><input type="submit" value="Submit"></td>
            </tr>
              </table>
                </form>
    </body>
</html>

要通过标头发送POST,请查看以下内容。

至于省略html的部分,可以使用类似的替代语法

<?php if ($a == 5): ?>
<p>This will be omitted if condition is not true</p>
<?php endif; ?>

类似的方法也可用于for循环。

阅读更多关于替代语法的信息。