Variable from PHP to HTML...
| From: | SBCSI) | Date: | Tue, 12 Nov 2002 21:56:00 +0000 |
| Subject: | Variable from PHP to HTML... | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-23267@lists.php.net to get a copy of this message | ||
I am attempting to create a form of system names that is populated
from a database query. The database query is working fine, and the form
population is actually working fine also. The question I have is about
organizing the variables that result from the form. I want to use the
system name as the variable name but I am having trouble figuring out how to
do this. Below is what I currently have working:
<form name="form1" method="post" action="">
<table border="0" align="center">
<?php do {
$sys = $system['Name'];
if ($cnt == 1) {
$cnt = 2;
echo "<tr>"; ?>
<td width="161"><input name="system" type="checkbox"
value="name">
<?php echo $sys; ?></td>
I would like to be able to access this variable "$sys" from the HTML
code. Is this possible? I am thinking something like this, but it doesn't
appear to work:
<form name="form1" method="post" action="">
<table border="0" align="center">
<?php do {
$sys = $system['Name'];
if ($cnt == 1) {
$cnt = 2;
echo "<tr>"; ?>
<td width="161"><input name="$sys" type="checkbox"
value="name">
<?php echo $sys; ?></td>
Thanks in advance for the help.
Scott Nipp
Phone: (214) 858-1289
E-mail: sn4265@sbc.com
Web: http:\\ldsa.sbcld.sbc.com