0

我有一个简单的页面,用户可以在其中输入他们的信息以获取某种类型的请求,然后我有一个单独的页面来回显用户输入的信息。如何在回显信息的每一行中输入复选框和文本框?该复选框用于请求完成时以及输入谁完成请求的文本框,一切正常,但我想知道这是否可能?我真的只是想指出正确的方向,因为我似乎无法找到我正在寻找的东西。感谢任何帮助,感谢,我会添加我所拥有的。谢谢

mysql_select_db('mydb');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
{
echo "First Name:{$row['firstname']}  <br> ".
     "Last Name: {$row['lastname']} <br> ".
     "Model ID: {$row['modelid']} <br> ".
     "System: {$row['system']} <br> ".
     "Department:{$row['department']}  <br> ".
     "Shift: {$row['shift']} <br> ".
     "Comm: {$row['comm']} <br> ".
     "Other: {$row['other']} <br> ".
     "Comments: {$row['comments']} <br> ".
     "Timestamp: {$row['timestamp']} <br> ".
     "TickeID: {$row['TicketID']} <br> ".
     "-----------------------------------------------------------<br>";
} 
echo "Fetched data successfully\n";
mysql_close($conn);
4

1 回答 1

0

“如何在回显信息的每一行中输入复选框和文本框?”

mysql_select_db('mydb');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
    die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
{
    echo "First Name:{$row['firstname']}  <br> ".
    "Last Name: {$row['lastname']} <br> ".
    "Model ID: {$row['modelid']} <br> ".
    "System: {$row['system']} <br> ".
    "Department:{$row['department']}  <br> ".
    "Shift: {$row['shift']} <br> ".
    "Comm: {$row['comm']} <br> ".
    "Other: {$row['other']} <br> ".
    "Comments: {$row['comments']} <br> ".
    "Timestamp: {$row['timestamp']} <br> ".
    "TickeID: {$row['TicketID']} <br> ".
    "-----------------------------------------------------------<br>".
    "<form action='target.php' method='POST'>"
        "<input type='checkbox' id='1' value='Option 1'>Option 1<br />".
        "<input type='checkbox' id='2' value='Option 2'>Option 2".
        "<input type='text' id='textBox1' value='' />".
    "</form>";
} 
echo "Fetched data successfully\n";
mysql_close($conn);

您应该养成将字符串绑定到变量并使用变量而不是普通字符串的习惯,这只是一种更好的做法。

于 2013-02-28T12:30:38.290 回答