RE: Array problem...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dunno if its relevant, but the recommended way to use sessions is to assign stuff to a $_SESSION['varname']...I don't really see anything wrong with the code...

Also, what arrays are causing the problems?

bastien


From: "NIPP, SCOTT V (SBCSI)" <sn4265@xxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
Subject:  Array problem...
Date: Fri, 16 Sep 2005 09:04:34 -0500

	I am migrating a web app from an old server running PHP 4.2.3 to
a new server running 4.3.8.  The problem I am running into at the moment
is building an array and passing it to another page.  This code works
fine on the old server, but the array is not coming across to the new
page on the new server.  Help...

mysql_select_db($database, $Prod);
$shell_list = getEnumOptions('accounts','shell');
$shell_tmp = "<select size=\"1\" name=\"shell[]\">\n";
$shell_tmp .= "<option>Default Shell</option>\n";
$shell_tmp .= "<option>-------------</option>\n";
foreach ($shell_list as $item) {
  $shell_tmp .= "<option>$item</option>\n";
}
$shell_tmp .= "</select>\n";

$query_groups = "SELECT name FROM grps";
$groups_tmp = mysql_query($query_groups, $Prod) or die(mysql_error());
$grp_list = "<select size=\"1\" name=\"grp[]\">\n";
$grp_list .= "<option>Primary Group</option>\n";
$grp_list .= "<option>-----------</option>\n";
while($item2 = mysql_fetch_row($groups_tmp)) {
  $grp_list .= "<option>$item2[0]</option>\n";
}
$grp_list .= "</select>\n";

<SNIP>

<?php
  while (isset($_POST['system'][$cntr])) {
   	echo "<td width=\"20%\"><div align=\"center\"><font
class=\"style3\">".$_POST['system'][$cntr]."</font></div></td>";
	echo "<td width=\"20%\"><div
align=\"center\">".$shell_tmp."</div></td>";
	echo "<td width=\"20%\"><div
align=\"center\">".$grp_list."</div></td>";
	echo "<td width=\"20%\"><div align=\"center\"><input
type=\"text\" name=\"other[]\" value=\"\" size=\"15\"></div></td></tr>";
	$tmp = $sbcuid."-".$_POST['system'][$cntr];
	$cntr++;
	array_push( $accnts, $tmp );
  }
?>
</table>
<p align="center"><font class="style3"><strong>If the systems listed
above are correct, please
    proceed. Otherwise, please hit the Back button on your browser and
review your
    system selections again.</strong></font></p><p
align="center">&nbsp;</p>
<?php
  session_register("accnts", "shell", "grp", "other", "cntr");
?>

Scott Nipp
Phone:  (214) 858-1289
E-mail:  sn4265@xxxxxxx
Web:  http:\\ldsa.sbcld.sbc.com

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux