PHP无效的HTML [关闭]

I'm using Apache as a server, my index.php code is

<?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>

but when I visit index.php , the webpage is always loading, and my background picture doesn't show(it may means HTML code are not working), I think the key point is that i used "goto",made the if-loop to wait for file, but i don't know how to slove it .

  1. In this code, there is actually not much that could work. I don't know where $file could come from, it looks like it's undefined so your goto will result in an infinite loop.
  2. Then you have to have an if to use else.
  3. There is no output because of the infinite loop, so it is blank while loading. And I can't even see what the page should show because I don't know whats behind <my HTML code>. There is no output in the code you've posted.