如何 - 使用 PHP 实现动态化
我有一个针对 php 文件进行操作的表单。一旦表单完成并将数据插入数据库,它希望它显示“Awesome”。 Awesome 正在显示,但位于表单上方。我希望它能够取代表单并显示出很棒的效果。我该怎么做?
谢谢。
if($done )
{
echo "Awesome";
}
else
{
echo "Error";
}
I have a form which actions against a php file. Once the form is completed and the data is inserted into the databse, it want it to display "Awesome". Awesome is being displayed but is above the form. I want it to replace the form and display awesome. How do i do that?
Thank You.
if($done )
{
echo "Awesome";
}
else
{
echo "Error";
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用
if/else
控制结构创造奇迹< /a>.You can make wonders with the
if/else
control structure.想必您有类似的内容:
将其更改为
Presumably you have something along the lines of:
Change it to
如果您对以提供所需结果的方式构建代码感到不知所措,那么您应该利用 PHP 的
include()
功能。将表单放入第二个文件中,然后重写结果逻辑:或者无论您希望表单出现在哪里。
If you are overwhelmed with structuring your code in a way that gives the desired result, then you should take advantage of PHPs
include()
capability. Put your form in a second file, then rewrite your result logic:Or wherever you want the form to appear.