This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
PHP 块不能跨越文件。 看起来这就是您正在尝试做的事情。
另外,如果您打破块直接输出 HTML,我发现使用 替代语法。
PHP blocks cannot span files. It looks like that is what you are trying to do.
Also if you are breaking out of blocks to output HTML directly, I find it more readable to use the alternative syntax.
您的代码有一些问题。 我建议查看一些有关 IF 语句的教程以了解它们的工作原理。 这是一个很好的网站,可以帮助您执行此操作。
www.tizag.com
更新以反映评论:
表单之前的PHP代码块并将其放入toppart.php
------------------您的表单代码在这里------ ---------------
将此 PHP 代码块放在表单后面并将其放入 middlepart.php
您的新代码将如下所示:
不幸的是,人们对此网站会让您很难发布此类问题,因此最好在来这里寻求帮助之前先进行研究。 当您无法解决问题时,PHP 编码可能会非常令人沮丧。 我是来帮忙的。 如果您还有任何疑问,请随时发表评论。
祝你好运! 学习 PHP 是非常有益的。
There are a few things wrong with your code. I recommend looking at some tutorials for IF statements to understand how they work. Here is a good web site for you to do this.
www.tizag.com
UPDATE to reflect comments:
Take the PHP code block before the form and put it into toppart.php
------------------Your Form Code is here---------------------
Take this PHP code block after the form and put it into middlepart.php
Your new code will look like the following:
Unfortunately people on this web site will give you a hard time for posting questions such as these so it is good to do research before coming here for help. PHP coding can be very frustrating when you cannot figure out a problem. I am here to help. If you have any more questions feel free to leave a comment.
Best of Luck!! Learning PHP can be very rewarding.
有一个意外的“}”,您缺少顶部的
if(var){
。There's an unexpected '}', you're missing an
if(var){
on top.