Can't put PHP form in a table

一曲冷凌霜 提交于 2019-12-02 12:26:16
Scott
<h2 class="green">Interested in making life easier?</h2>
<form method="post" action="sendemail.php">
    <?php
    $ipi = getenv("REMOTE_ADDR");
    $httprefi = getenv ("HTTP_REFERER");
    $httpagenti = getenv ("HTTP_USER_AGENT");
    ?>
    <input type="hidden" name="ip" value="<?php echo $ipi ?>" />
    <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
    <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
    <table>
        <tr>
            <td><label for="visitor">Name:</label></td>
            <td><input type="text" name="visitor" size="25" /></td>
        </tr>
        <tr>
            <td><label for="visitoradd">Address:</label></td>
            <td><input type="text" name="visitoradd" size="25" /></td>
        </tr>
        <tr>
            <td><label for="visitorcity">City:</label></td>
            <td><input type="text" name="visitorcity" size="15" /></td>
        </tr>
        <tr>
            <td><label for="visitorpost">Postcode:</label></td>
            <td><input type="text" name="visitorpost" size="15" /></td>
        </tr>
        <tr>
            <td><label for="visitormail">E-mail:</label></td>
            <td><input type="text" name="visitormail" size="25" /></td>
        </tr>
        <tr>
            <td><label for="visitortel">Telephone Number:</label></td>
            <td><input type="text" name="visitortel" size="25" /></td>
        </tr>
        <tr>
            <td><label for="bp">Bookkeeping/Payroll:</label></td>
            <td>
                <select name="bp" size="1">
                    <option value=" Bookkeeping">Bookkeeping </option>
                    <option value=" Payroll ">Payroll</option>
                </select>
            </td>
        </tr>
        <tr>
            <td><label for="transcations">Number of transactions:</label></td>
            <td><input type="text" name="transcations" size="15" /></td>
        </tr>
        <tr>
            <td><label for="employees">Number of employees:</label></td>
            <td><input type="text" name="employees" size="15" /></td>
        </tr>
        <tr>
            <td><label for="pmw">Payroll weekly/monthly:</label></td>
            <td>
            <select name="pmw" size="1">
                <option value=" Weekly">Weekly</option>
                <option value=" Monthly">Monthly</option>
            </select>
            </td>
        </tr>
    </table>
    <br />
    <INPUT TYPE="image" SRC="images/btnSubmit.png" ALT="Submit Form">
    <br />
</form>

Place the form tags outside of the table like so:

<form>
  <TABLE>
  <TR>
    <TD>Name</TD>
    <TD><input type="text" name="visitor" size="25" /></TD>
  </TR>
  <TR>
    <TD>Address</TD>
    <TD><input type="text" name="address" size="25" /></TD>
  </TR>
  </TABLE>
</form>

If you are needing to specify width, height, etc.. then use CSS.

Here is a great tutorial on it: http://www.w3schools.com/css/

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!