[英]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.