我很难让我的表单工作。基本上我希望表格单元格中的内容回显给表单,以便在需要时可以附加它。
我的建设不起作用所以我需要帮助...
这是3部分...... var
<?php
$companyData = array();
if (($handle = fopen("settings.txt", "w")) !== FALSE)
{
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE)
{
if(substr(trim($data[0]), 0, 3) == 'DAT')
{
$board = trim($data[0]);
$temp = $data[1];
$companyData[ $board ] = $temp;
}
}
fclose($handle);
}
$emailData = array();
if (($handle = fopen("settings.txt", "w")) !== FALSE)
{
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE)
{
if(substr(trim($data[0]), 0, 3) == 'DAT')
{
$board = trim($data[0]);
$temp = $data[2];
$emailData[ $board ] = $temp;
}
}
fclose($handle);
}
?>
第二部分是html ......
<form action="settingsnew.php" method="post">
<table width="422">
<tr align="center">
<td colspan="2">CUSTOMER INFO</td>
</tr>
<tr>
<td>company name</td>
<td><input name="company" type="text" id="company" value="<?php echo str_replace("<br />","",$companyData); ?>" /></td>
</tr>
<tr>
<td>email (main)</td>
<td><input name="email" type="text" id="email" value="<?php echo str_replace("<br />","",$emailData); ?>" /></td>
</tr>
<tr>
<td> </td>
<td><input name="myBtn" type="submit" /></td>
</tr>
</table>
</form>
最后是数据库......
DAT 0; ONE ; TWO ;
我的表格显然不起作用,但我觉得我很亲密。任何人都可以帮我这个吗?