Cant Get Data
am 21.02.2011 18:09:25 von gary
I have a 3 step form that calls the data from a mysql DB. First is a
dropdown to select a state, which then brings up a dynamically created check
list of the counties in that state, so far all works well. I am unable to
get the checkbox choices to appear on the third page.
If someone could take a look at this and tell me where I am going wrong.
This is the code for the page that creates the checkboxes. There are some
extra lines in there where I was trying to get it to work. Again this works
fine, but my guess is that see this may shed light.
$county1=$_SESSION['county$i'];
$counties=$_SESSION['counties'];
$row_name=$_SESSION['name'] = $row[name];
$count_choice=$_SESSION['name'];
$result1=$_SESSION['$result'];
$choice=$_POST['state'];
if ( isset($_POST['submit']) ) { // if form is submitted, process it
for($i=1; $i<=$_POST['counties']; $i++) {
if ( isset($_POST["county$i"] ) ) {
print $_POST["county$i"]." is checked.
";
}
}
} else { // if form isn't submitted, output the form
$county_choice=$_SESSION['county$1'];
print "
Re: Cant Get Data
am 22.02.2011 14:55:08 von Amit Tandon
--20cf3054ace37b9d0a049cdf5531
Content-Type: text/plain; charset=UTF-8
Dear Gary
$_SESSION variable would be available only if you have session_start() at
the top of the page. For $_POST, i presume u hve method POST defined for the
form element
============
regds
amit
"The difference between fiction and reality? Fiction has to make sense."
On Mon, Feb 21, 2011 at 10:39 PM, Gary wrote:
> I have a 3 step form that calls the data from a mysql DB. First is a
> dropdown to select a state, which then brings up a dynamically created
> check
> list of the counties in that state, so far all works well. I am unable to
> get the checkbox choices to appear on the third page.
>
> If someone could take a look at this and tell me where I am going wrong.
>
> This is the code for the page that creates the checkboxes. There are some
> extra lines in there where I was trying to get it to work. Again this works
> fine, but my guess is that see this may shed light.
>
>
> $county1=$_SESSION['county$i'];
> $counties=$_SESSION['counties'];
> $row_name=$_SESSION['name'] = $row[name];
> $count_choice=$_SESSION['name'];
> $result1=$_SESSION['$result'];
> $choice=$_POST['state'];
> if ( isset($_POST['submit']) ) { // if form is submitted, process it
>
> for($i=1; $i<=$_POST['counties']; $i++) {
> if ( isset($_POST["county$i"] ) ) {
> print $_POST["county$i"]." is checked.
";
> }
> }
>
> } else { // if form isn't submitted, output the form
> $county_choice=$_SESSION['county$1'];
> print "