stuck trying to retrieve values on next page

Hi all

I have two objects a text box and a dropdown box on my initial webpage. I can retreive the dropdown box values on my second page with a foreach loop but cannot seem to retreive the text box values.

is there something I am doing wrong here

page 1

[code]

while ( ( $data = fgetcsv( $handle, $length, $delimiter ) ) !== FALSE )

{

if( $rows == 0 )

{

$num = count($data);

for ($c=0; $c < $num; $c++)

{ 

echo “

”;
echo "<tr width=25% align=right><td>";
for ($d=0; $d < $num; $d++)                

{  

 //echo "<option value='" .$data[$d]."'>" .$data[$d]."</option>";

}

echo “”;

echo "</td>";

  echo "<td width=20% align=left>";

  ?> <---- Matches to -----> <select name="<?php echo "dropdown[" .$c."]" ?>" id="<?php echo "dropdown[" .$c."]" ?>" class="nohide" onchange="fillSelect(this,categories[this.value],'<?php echo "dropdown" .$counter++ ?>')"><?php

  echo "<option selected>Please Choose</option>";

  echo "<option value='Manufacturer" .$c. "'>Software Manufacturer</option>";

  echo "<option value='Product" .$c. "'>Product Name</option>";

  echo "<option value='Version" .$c. "'>Product Version</option>";

  echo "<option value='Keep Existing" .$c. "'>Keep Existing</option>";

  echo "<option value='Ignore" .$c. "'>Ignore</option>";   

  ?></select>

}
[/code

page 2


foreach ($_POST[$data] as $datanumcolumns=>$datadownboxValue){
 echo "Textbox value" .$datanumcolumns. " has a value of " .$datadownboxValue. " "?><br /><br /><?php 
}

foreach ($_POST['dropdown'] as $numcolumns=>$dropdownboxValue){
 echo "Dropdown array value is " .$numcolumns. " and the dropdown value is " .$dropdownboxValue. " "?><br /><br /><?php 
}

The only input field you show in the code is disabled and doesn’t have a name to i either, so php can’t do anything with it.

hi fastol

is there a way around this to retrieve them

thanks

No, if it’s disabled and doesn’t have a name, php will never see it.

I have changed the disabled to readonly can it be done now.

it can be done.

I managed to change textbox to readonly

<input type="text" name="<?php echo "textbox[" .$c ."]" ?>" id="<?php echo "textbox[" .$data[$c]."]" ?>" value="<?php echo $data[$c] ?>" readonly="readonly" style="background-color:White; color:Black;">

then

foreach ($_POST['textbox'] as $datanumcolumns=>$datadownboxValue){
 echo "Textbox value" .$datanumcolumns. " has a value of " .$datadownboxValue. " "?><br /><?php 
}
Sponsor our Newsletter | Privacy Policy | Terms of Service