我如何...创建一个PHP表单,列出没有数据库的提交值? [英] How do I...create a PHP form that lists submitted values without database?

查看:78
本文介绍了我如何...创建一个PHP表单,列出没有数据库的提交值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。

i想要创建一个名为foo.php的HTML表单,其中包含用户名文本框,以便在同一文件中将用户名提交给php部分代码。

然后在文件的php部分显示列出的所有用户名。不使用数据库或javascript。

当我提交代码时,会列出用户名。但是当我提交另一个用户名时,之前的用户名将在列表中清除,并显示新的用户名。当我想要时使用数组来保存用户名,然后在我点击submit后重置变量的内容。我附上了我想要的图片。



< a href =http://s6.picofile.com/file/8181776626/sdsadsad.png>我真正想要的图片



这是代码:



hi.
i want to create an HTML form with a name like foo.php with a username textbox so that it Submits the username to php part of the code on the same file.
and then in the php part of file it show all the usernames listed. without using a Database or javascript.
when i submit the code then username is listed.but when i submit another username then the previous username is cleared on the list and the new one is shown.when i want to use an array to save the username in it then it resets the contents of the variable after i click submit.i have attached the picture of what i want.

the picture of what i really mean

here's the code:

<form action="index.php" method="get">
Username:<input type="text"  name="uname" /><br />
<input type="submit" />
<input type="reset" />
</form>




$username=@$_GET['uname'];
echo '<table border="1"> <tr> <td>'.$username.' </td> </tr>  </table><br>';
}

推荐答案

username = @
username=@


_GET [' uname'];
echo ' < table border = 1\" > < TR> < td>'
_GET['uname']; echo '<table border="1"> <tr> <td>'.


username。' < / TD> < / TR> < /表><峰; br>';
}
username.' </td> </tr> </table><br>'; }


这篇关于我如何...创建一个PHP表单,列出没有数据库的提交值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆