Forms and Arrays

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Frozenlight777
Forum Commoner
Posts: 75
Joined: Wed May 28, 2008 12:59 pm

Forms and Arrays

Post by Frozenlight777 »

i'm confused a bit... I have the form that displays the contents of a xml file. It displays fine through the loop but now I want to have that information process to another page.

Code: Select all

<html>
<form method="POST"  action="uploadlist.php">   
    <table align="center" border="1" width="600">
    
    <tr>
        <th>Asset Tag</th>
        <th>Type</th>
        <th>Service Tag</th>
        <th>User</th>
    </tr>
        <?php foreach( $data as $row ) { ?>
            <tr>
                <td><input name="Asset_Tag" value = "<?php echo( $row['Asset_Tag']); ?> "/></td>
                <td><input name="Type" value = "<?php echo( $row['Type']); ?> "/></td>
                <td><input type="hidden" name="Service_Tag" value = "<?php echo( $row['Service_Tag']); ?>"/></td>
                <td><input name="User" value = "<?php echo($row['User']); ?> "/></td> 
                <td><input type="hidden" name="_submit_check" value="1"/> </td>
            </tr>
            <?php
            } ?>
        <td><input type="submit" value="Send to Database"/></td>        
    </table>
</form>
</html>
[/size]

the variables display when the page loads but when I click the form button how do I process the array on another page because POST doesn't seem to work.
hansford
Forum Commoner
Posts: 91
Joined: Mon May 26, 2008 12:38 am

Re: Forms and Arrays

Post by hansford »

Not understanding what you're trying to do. You have a form thats written out by php and the values are received from a database. Why does the user need to submit anything - the values are already given. The $_POST won't work because they aren't going to be set by an echo. Get the database info you want and place it in $_SESSION variables
Post Reply