简体   繁体   English

我的页面显示了它需要显示的内容,但是当我刷新页面时,我得到了一个空白页面

[英]My page shows what it needs to show , but when I refresh the page gives me a blank page

<?PHP
if(isset($_POST['versturen'])){
            include 'Databankverbinden.php';
            $Jurylid=$_POST['Jurylid'];
            $Organisatie=$_POST['Organisatie'];
            $Firma=$_POST['Firma'];
            $Standnummer=$_POST['Standnummer'];
            $Aanmelden=$_POST['Aanmelden'];
            $Ontvangst=$_POST['Ontvangst'];
            $Contact=$_POST['Contact'];
            $Gesprek=$_POST['Gesprek'];
            $Luisteren=$_POST['Luisteren'];
            $ProductKennis=$_POST['ProductKennis'];
            $HandelKennis=$_POST['HandelKennis'];
            $Onderhandelen=$_POST['Onderhandelen'];
            $TaalGebruik=$_POST['TaalGebruik'];
            $Voorkomen=$_POST['Voorkomen'];
            if (!isset($Jurylid, $Organisatie, $Firma, $Standnummer, $Aanmelden, $Ontvangst, $Contact, $Gesprek, $Luisteren, $ProductKennis, $HandelKennis, $Onderhandelen, $TaalGebruik, $Voorkomen)) {
        echo "<script>alert('Zorg dat alles ingevuld is!')</script>";
        echo "<script>document.location.href='Enquete.php'</script>";

    }
            $TotaalScore=$Voorkomen + $TaalGebruik + $Aanmelden + $Ontvangst + $Contact + $Gesprek + $Luisteren + $ProductKennis + $HandelKennis + $Onderhandelen;
            $sql="INSERT INTO punten(Jurylid, Organisatie, Firma,StandNummer ,Aanmelden,Ontvangst,Contact,Gesprek ,Luisteren ,ProductKennis ,HandelKennis,Onderhandelen,TaalGebruik,Voorkomen,TotaalScore) VALUES ('$Jurylid','$Organisatie','$Firma', '$Standnummer' ,'$Aanmelden','$Ontvangst','$Contact','$Gesprek' ,'$Luisteren' ,'$ProductKennis' ,'$HandelKennis','$Onderhandelen','$TaalGebruik','$Voorkomen','$TotaalScore')";
            $result=mysql_query($sql)or die;
            $sql = "SELECT * FROM punten;";
            $result=mysql_query($sql)or die;
                echo "<table border='3'>";
                echo "<tr><td> Firma naam :</td><td>StandNummer:</td><td>Totaalscore</td></tr>";
                    while($row=mysql_fetch_array($result)){
                        echo ('<tr><td>'.$row["Firma"] . '</td><td>' . $row["StandNummer"] . '</td><td>' . $row["TotaalScore"] . '</td></tr>');
            }
            }

?>
<html>
    <head>
    </head>
        <body background="Kleur.jpg">
            <form action="Apart.php" method="POST">
                <table>
                    <tr><td>Als u de aparte score wilt zien moet u op deze knop klikken</td></tr>
                    <tr><td><input type="submit" name="versturen" value="Scores" action="versturen"></td></tr>
                </table>
            </form>
        </body>
</html>

When I first time come on the page , it doesn't give any problem , if I use the the link to go to another page , and come back it also doesn't give any problem , but when I am on this page and refresh it goes blank , a full white screen , what's my problem here. 当我第一次进入页面时,如果我使用链接转到另一个页面,再返回时也没有任何问题,但是当我在此页面上并刷新时,它不会有任何问题。它变成空白,全屏,这是我的问题。 Is it the isset doing annoying or has it do anything with the POST because he wants to get the information but the previous page is this page , so he doesn't recognize the info? 是isset烦人的事还是对POST做任何事,因为他想获取信息,但上一页是此页面,因此他无法识别该信息? PS : The language is dutch , dont mind that :D PS:语言是荷兰语,别介意:D

I can't comment - because of 50 Rep ... 我无法发表评论-因为有50名代表...

More a comment, than a answer: 评论多于答案:

error_reporting(E_ALL); 
ini_set('display_errors', 1); 

If you ever have problems turn error-reporting on. 如果您遇到问题,请打开错误报告功能。

Also your code is a bit confusing. 而且您的代码有点混乱。

You output html before the -Tag. 您在-Tag之前输出html。 Where is the closing table-Tag? 收盘价牌在哪里? ?

Format your code and you will have 50%+ less errors. 格式化您的代码,您的错误将减少50%以上。 Maybe this will do it, it's just an example, double check it again: 也许这样做,仅是一个例子,请再次仔细检查:

<html>
    <head>
    </head>
        <body background="Kleur.jpg">

                <?php
                if(isset($_POST['versturen'])){
                        include 'Databankverbinden.php';
                        $Jurylid=$_POST['Jurylid'];
                        $Organisatie=$_POST['Organisatie'];
                        $Firma=$_POST['Firma'];
                        $Standnummer=$_POST['Standnummer'];
                        $Aanmelden=$_POST['Aanmelden'];
                        $Ontvangst=$_POST['Ontvangst'];
                        $Contact=$_POST['Contact'];
                        $Gesprek=$_POST['Gesprek'];
                        $Luisteren=$_POST['Luisteren'];
                        $ProductKennis=$_POST['ProductKennis'];
                        $HandelKennis=$_POST['HandelKennis'];
                        $Onderhandelen=$_POST['Onderhandelen'];
                        $TaalGebruik=$_POST['TaalGebruik'];
                        $Voorkomen=$_POST['Voorkomen'];

                        if (!isset($Jurylid, $Organisatie, $Firma, $Standnummer, $Aanmelden, $Ontvangst, $Contact, $Gesprek, $Luisteren, $ProductKennis, $HandelKennis, $Onderhandelen, $TaalGebruik, $Voorkomen)) {
                            echo "<script>alert('Zorg dat alles ingevuld is!')</script>";
                            echo "<script>document.location.href='Enquete.php'</script>";

                        }

                        $TotaalScore=$Voorkomen + $TaalGebruik + $Aanmelden + $Ontvangst + $Contact + $Gesprek + $Luisteren + $ProductKennis + $HandelKennis + $Onderhandelen;
                        $sql= "INSERT INTO punten(
                                Jurylid,
                                Organisatie,
                                Firma,
                                StandNummer,
                                Aanmelden,
                                Ontvangst,
                                Contact,
                                Gesprek,
                                Luisteren,
                                ProductKennis,
                                HandelKennis,
                                Onderhandelen,
                                TaalGebruik,
                                Voorkomen,
                                TotaalScore)
                            VALUES (
                                '$Jurylid',
                                '$Organisatie',
                                '$Firma',
                                '$Standnummer',
                                '$Aanmelden',
                                '$Ontvangst',
                                '$Contact',
                                '$Gesprek',
                                '$Luisteren',
                                '$ProductKennis',
                                '$HandelKennis',
                                '$Onderhandelen',
                                '$TaalGebruik',
                                '$Voorkomen',
                                '$TotaalScore')";
                        $result=mysql_query($sql)or die;
                        $sql = "SELECT * FROM punten;";
                        $result=mysql_query($sql)or die;
                            echo "<table border='3'>
                                    <tr>
                                        <td> Firma naam :</td>
                                        <td>StandNummer:</td>
                                        <td>Totaalscore</td>
                                    </tr>";
                            while($row=mysql_fetch_array($result)){
                                echo '<tr>
                                        <td>'.$row["Firma"] . '</td>
                                        <td>' . $row["StandNummer"] . '</td>
                                        <td>' . $row["TotaalScore"] . '</td>
                                    </tr>';
                            }
                            echo '</table>';
                    }
                ?>
            <form action="Apart.php" method="POST">
                <table>
                    <tr>
                        <td>Als u de aparte score wilt zien moet u op deze knop klikken</td>
                    </tr>
                    <tr>
                        <td><input type="submit" name="versturen" value="Scores" action="versturen"></td>
                    </tr>
                </table>
            </form>
        </body>
</html>

EDIT: 编辑:

Aha! 啊哈! You don't have a database connection after the if! if之后,您没有数据库连接! Try this: 尝试这个:

<html>
    <head>
    </head>
        <body background="Kleur.jpg">

                <?php
                include 'Databankverbinden.php';
                if(isset($_POST['versturen'])){  
                        $Jurylid=$_POST['Jurylid'];
                        $Organisatie=$_POST['Organisatie'];
                        $Firma=$_POST['Firma'];
                        $Standnummer=$_POST['Standnummer'];
                        $Aanmelden=$_POST['Aanmelden'];
                        $Ontvangst=$_POST['Ontvangst'];
                        $Contact=$_POST['Contact'];
                        $Gesprek=$_POST['Gesprek'];
                        $Luisteren=$_POST['Luisteren'];
                        $ProductKennis=$_POST['ProductKennis'];
                        $HandelKennis=$_POST['HandelKennis'];
                        $Onderhandelen=$_POST['Onderhandelen'];
                        $TaalGebruik=$_POST['TaalGebruik'];
                        $Voorkomen=$_POST['Voorkomen'];

                        if (!isset($Jurylid, $Organisatie, $Firma, $Standnummer, $Aanmelden, $Ontvangst, $Contact, $Gesprek, $Luisteren, $ProductKennis, $HandelKennis, $Onderhandelen, $TaalGebruik, $Voorkomen)) {
                            echo "<script>alert('Zorg dat alles ingevuld is!')</script>";
                            echo "<script>document.location.href='Enquete.php'</script>";

                        }

                        $TotaalScore=$Voorkomen + $TaalGebruik + $Aanmelden + $Ontvangst + $Contact + $Gesprek + $Luisteren + $ProductKennis + $HandelKennis + $Onderhandelen;
                        $sql= "INSERT INTO punten(
                                Jurylid,
                                Organisatie,
                                Firma,
                                StandNummer,
                                Aanmelden,
                                Ontvangst,
                                Contact,
                                Gesprek,
                                Luisteren,
                                ProductKennis,
                                HandelKennis,
                                Onderhandelen,
                                TaalGebruik,
                                Voorkomen,
                                TotaalScore)
                            VALUES (
                                '$Jurylid',
                                '$Organisatie',
                                '$Firma',
                                '$Standnummer',
                                '$Aanmelden',
                                '$Ontvangst',
                                '$Contact',
                                '$Gesprek',
                                '$Luisteren',
                                '$ProductKennis',
                                '$HandelKennis',
                                '$Onderhandelen',
                                '$TaalGebruik',
                                '$Voorkomen',
                                '$TotaalScore')";
                        $result=mysql_query($sql)or die;
                        $sql = "SELECT * FROM punten;";
                        $result=mysql_query($sql)or die;
                            echo "<table border='3'>
                                    <tr>
                                        <td> Firma naam :</td>
                                        <td>StandNummer:</td>
                                        <td>Totaalscore</td>
                                    </tr>";
                            while($row=mysql_fetch_array($result)){
                                echo '<tr>
                                        <td>'.$row["Firma"] . '</td>
                                        <td>' . $row["StandNummer"] . '</td>
                                        <td>' . $row["TotaalScore"] . '</td>
                                    </tr>';
                            }
                            echo '</table>';
                    }
                ?>
            <form action="Apart.php" method="POST">
                <table>
                    <tr>
                        <td>Als u de aparte score wilt zien moet u op deze knop klikken</td>
                    </tr>
                    <tr>
                        <td><input type="submit" name="versturen" value="Scores" action="versturen"></td>
                    </tr>
                </table>
            </form>
        </body>
</html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我尝试显示上传的图像html时会显示另一幅图像,但是如果刷新页面会显示正确的图像 - When I try to show an uploaded image html shows me another one but if I refresh the page it shows me the right one PHP给我空白页 - PHP Gives me a blank page 虽然我正确创建了路线但是当我尝试显示页面时它给了我一个找不到错误页面 - Although I created the route correctly But when I try to show the page It gives me an error page not found Laravel Blade compileString 给了我一个空白页 - Laravel Blade compileString gives me a Blank Page 我在网页上显示了用户的电子邮件,但是当我在移动设备上拉出该页面时,有时却不显示 - I show the user's email on my web page but when I pull this page on mobile, it sometimes shows sometimes not 表单提交(POST)到php页面给出空白页面,除非我刷新 - Form submit (POST) to php page gives blank page unless I refresh PHP:我的session_variables显示页面刷新的时间 - PHP:my session_variables shows when the page refresh 我要在我的克隆元素显示后重新加载/刷新页面 - i want to reload/refresh page after my cloned element shows xampp-不会显示特定页面-它会显示空白页面 - xampp - won't show certain page - it shows blank page 登录页面显示空白 - Login page shows blank
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM