【发布时间】:2013-04-21 16:47:27
【问题描述】:
我使用 Apache 作为服务器, 我的 index.php 代码是
<?php session_start(); ?>
<html>
<my HTML code>
<?php
wait_file:{
// Do something to receive file.
}
else
{
goto wait_file;
}
}
detect_file:{
if(file_exists($file))
{
// do something with received file.
}
else
{
goto detect_file;
}
}
?>
</html>
但是当我访问 index.php 时, 网页总是在加载, 并且我的背景图片没有显示(这可能意味着 HTML 代码不起作用), 我认为关键是我使用了“goto”,使 if-loop 等待文件, 但我不知道如何解决它。
【问题讨论】:
-
什么意思?更加详细一些。我不知道你是否真的理解你的问题
-
如果
is always loading表示它确实不停止加载,那么你的PHP 代码就是你的问题,而不是 HTML。 -
我的 index.php 是空白的,我猜我的 html 代码不起作用。
-
你知道怎么解决吗?我需要 PHP 部分,我不能让页面空白:(