Hey all, Im trying to put a submit news box on my admin page but for some reason my top box, Headline: "Textbox here", is not showing up on my page. Am I doing something wrong? Did I miss a tag somewhere?? Thanks in advance.

<tr>
    <td>
    <br>
    <!--Display Add News Box-->
    <h3>Add News</h3>
    <table>
    <form action="admin/adminprocess.php" method="post>
        <tr><td>
        Headline:<br>
        <input type="text" name="headline" maxlength="50" value="<?php echo $form->value("headline"); ?>">
        </td>
        <td>
        Date:<br>
        <input type="text" name="date" maxlength="8" value="<?php echo $form->value("date"); ?>">
        </td></tr>
        <tr><td>
        Content:<br>
        <textarea type="text" rows="6" cols="50" name="text" maxlength="50" value="<?php echo $form->value("text"); ?>"></textarea><?php echo $form->error("text"); ?><br>
        </td></tr>
        <tr><td>
        <input type="hidden" name="subnews" value="1">
        <input type="submit" value="Submit News">
        </td></tr>
    </form>
    </table>
    </td>
    </tr>
    <tr>
    <td><hr></td>
    </tr>

Recommended Answers

All 3 Replies

What does the code look like when you view-source in a browser ( i.e. after the PHP code has been executed ). Post the same code after PHP, and check to make sure those echos don't put invalid characters inside the value attribute.

Are you using an XHTML DTD, a HTML DTD, or no specified DTD? [ that code uses HTML tag closure rules, so you shouldn't use an XHTML DTD, a HTML DTD is preferable, but no DTD should work functionally ]

Try putting the form element outside the table element ( i.e. <form><table>..</table></form> rather than <table><form>..</form></table> ). Only certain things should go directly inside <table> elements ( tbody, tr etc )

EDIT: Oops; I didn't see the solved marker on this thread... How did you solve the problem in the end?

heh, bad typing on my part

<form action="admin/adminprocess.php" method="post>

should be:

<form action="admin/adminprocess.php" method="POST">

You have the table and form tags tangled.

The form tag must not be between table and its tr.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.