一个输入框,查询txt的内容怎么做了?
时间:2011-12-05
来源:互联网
<?php
$file_handle = fopen("txt.txt", "r");
if ($file_handle)
{
$i = 0;
while ( ! feof($file_handle) )
{
$buffer = fgets($file_handle, 4096);
$data[$i] = $buffer;
$i ++;
}
fclose($file_handle);
}
foreach ($data as $k =>$v) {
if (strpos($v, '要查询的') !== false) {
echo "$v<br />";
}
}
?>
怎么把“要查询的”换成是textbox 再加个button
作者: csharpvb 发布时间: 2011-12-05
<?php
$file_handle = fopen("txt.txt", "r");
if ($file_handle)
{
$i = 0;
while ( ! feof($file_handle) )
{
$buffer = fgets($file_handle, 4096);
$data[$i] = $buffer;
$i ++;
}
fclose($file_handle);
}
foreach ($data as $k =>$v) {
if (strpos($v, '要查询的') !== false) {
$v = str_replace('要查询的', 'textbox <input type="button" name="" value="button">', $v);
echo "$v<br />";
}
}
?>
$file_handle = fopen("txt.txt", "r");
if ($file_handle)
{
$i = 0;
while ( ! feof($file_handle) )
{
$buffer = fgets($file_handle, 4096);
$data[$i] = $buffer;
$i ++;
}
fclose($file_handle);
}
foreach ($data as $k =>$v) {
if (strpos($v, '要查询的') !== false) {
$v = str_replace('要查询的', 'textbox <input type="button" name="" value="button">', $v);
echo "$v<br />";
}
}
?>
作者: ci1699 发布时间: 2011-12-05
不是吧。我想吧这个PHP应该是放到 form里面的 action
<form action="s.php" method="search" name="ipform" id="search" onsubmit="submit">
<tr>
<td onmouseover="this.style.backgroundColor='#E6F2E7'" onmouseout="this.style.backgroundColor=''" bgcolor="#cce6cd"><div style="text-align:center;font-size:14px; font-weight:bold; line-height:25px">输入:</div></td>
</tr>
<tr>
<td style="padding:15px"><div style="text-align:center;">
<input name="ip_num" id="ip_num" value="<?=$pre_words?>" size="30" />
<input type="submit" value="提 交" name="Submit" />
<input id="act" type="hidden" value="1" name="act" />
</div>
</td>
</tr>
</form>
$pre_words 这个是input要查的。
查询出来
<form action="s.php" method="search" name="ipform" id="search" onsubmit="submit">
<tr>
<td onmouseover="this.style.backgroundColor='#E6F2E7'" onmouseout="this.style.backgroundColor=''" bgcolor="#cce6cd"><div style="text-align:center;font-size:14px; font-weight:bold; line-height:25px">输入:</div></td>
</tr>
<tr>
<td style="padding:15px"><div style="text-align:center;">
<input name="ip_num" id="ip_num" value="<?=$pre_words?>" size="30" />
<input type="submit" value="提 交" name="Submit" />
<input id="act" type="hidden" value="1" name="act" />
</div>
</td>
</tr>
</form>
$pre_words 这个是input要查的。
查询出来
作者: csharpvb 发布时间: 2011-12-05
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28