Page 1 of 1

Forms and Arrays

Posted: Wed May 28, 2008 1:04 pm
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.

Re: Forms and Arrays

Posted: Thu May 29, 2008 4:45 am
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