简体   繁体   中英

PHP: Multiple forms aren't working except the first one?

This code generates multiple form associated with each product and its id.

But at html side only first is working. When I inspected the page I came to know that this code only generates form for first product only. Anyone Else faces this?

for ( $b = 0; $b < sizeof( $id ); $b++ ) {
    echo "
        <form action='Post.php' method='GET'>
            <div class='form-group' style='display:none' id='$id[$b]'>
                <label class='control-label'>Message</label>
                <input type='text' name='id' value='$id[$b]'style='display:none'>
                <input type='text' name='nam' value='admin 'style='display:none'>
                <textarea type='text' class='form-control ' rows='4' col='10'  name='mess' >
                </textarea>
                <input style='margin-top:10px' type='submit' class='btn btn-info' value='Submit'>
            </div>
        </from>";
}

You seem to close your form tag with 'from'. change /from to /form

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM