Re: Webpage response to selection & $_POST

From: Date: Mon, 30 Aug 2004 16:02:03 +0000
Subject: Re: Webpage response to selection & $_POST
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-35944@lists.php.net to get a copy of this message
Peter, On Aug 29, 2004, at 6:26 PM, Peter Lovatt wrote:
Hi you need to check for $_POST["user1"], $_POST["user2"] etc - is that what you are doing?
Yes, this is how I am checking the post variables.
Your other variables are done as an array - $firstName[$j] etc, should your check box be
     echo '	<td><input type="checkbox" name="user[' . $j . ']"
value="1"></td>' . "\n"; (note the [])
Why do you have to have the []'s? I did add those, but it didn't seem to help.
Otherwise try vardump($_POST) to see exactly what is being returned.
I also tried the vardump($_POST), and it did not seem to return anything. I did not find anything about vardump() on the php site... besides some non-built in function. Any more thoughts on using it?
If this does not fix it try posting the code that handles the response and we will try and help. Peter
Ok, quick question. Does the $_POST variable transfer the information to all the pages? or just the page called in that <form action="apage.php">? Because in my code I call a certain page, but then that page merely redirects to another page, depending what selection was made. The code that uses the $_POST information follows... ~Philip <?php for ($j=0; $j<=$largestDBID; $j++) {
    $user = "user[" . $j . "]";
    if ($_POST[$user]) {
        echo '<tr>' . "\n";
        echo '	<td>' . $dbid[$j] . '</td>' . "\n";
        echo '	<td>' . $firstName[$j] . '</td>' . "\n";
        echo '	<td>' . $lastName[$j] . '</td>' . "\n";
        echo '	<td>' . $uid[$j] . '</td>' . "\n";
        echo '	<td>' . $username[$j] . '</td>' . "\n";
        echo '	<td>' . $classification[$j] . '</td>' . "\n";
        echo '</tr>' . "\n";
    }
} ?>

« previous php.db (#35944) next »