简体   繁体   中英

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? PS : The language is dutch , dont mind that :D

I can't comment - because of 50 Rep ...

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. Where is the closing table-Tag? ?

Format your code and you will have 50%+ less errors. 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! 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM