我有一些问题,我有一个包含2个提交的POST表单。
我让2提交使用target =“a_blank”,但每当我尝试它时,它都没有执行我的PHP脚本。
我也尝试将javascript与我的PHP脚本结合使用,但它没有用。所以我拼命寻找答案。
所以我的问题是如何在我的PHP脚本中创建一个新的选项卡。
我的表格:
<div id="form-actie-container">
<span style="margin:auto; display:table; color: red; "><?php echo $error; ?></span>
<form enctype="multipart/form-data" method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<label for="name">Welkom bericht</label> <br>
<textarea type="text" id="Welkom-Bericht" name="Welkom-Bericht" placeholder="Teksts voor welkom"></textarea>
<br>
<label for="name">Arrangement bericht</label> <br>
<textarea type="text" id="Arrangement-Bericht" name="Arrangement-Bericht" placeholder="Tekts voor je Arrangement"></textarea>
<br>
<label for="name">Maasduin actie bericht</label> <br>
<textarea type="text" id="Maasduin-Actie-Bericht" name="Maasduin-Actie-Bericht" placeholder="Tekts voor Maasduin actie"></textarea>
<br>
<br>
<label>Foto-1</label>
<br>
<input type="file" name="image1" id="image" accept="image/*" "/>
<br>
<br>
<label>Foto-2</label>
<br>
<input type="file" name="image2" id="image" accept="image/*" "/>
<br>
<br>
<label>Foto-3 </label>
<br>
<input type="file" name="image3" id="image" accept="image/*" "/>
<br>
<br>
<label>Foto-4</label>
<br>
<input type="file" name="image4" id="image" accept="image/*" "/>
<br>
<br>
<label>Foto-5</label>
<br>
<input type="file" name="image5" id="image" accept="image/*" "/>
<br>
<br>
<br>
<label for="Actie-Code">Je email</label>
<br>
<input type="text" id="email"b name="email" placeholder="Je email..">
<br>
<label for="Actie-Code">Je actie code</label>
<br>
<input type="text" id="code" name="code" placeholder="Je Code..">
<br>
<br>
<input type="submit" name="actieSubmit" value="Betalen..">
<input type="submit" name="LookSubmit" value="Hoe ziet het eruit?..">
</form>
</div>
我的PHP脚本:
if (isset($_POST['LookSubmit'])) {
$welkom = $_SESSION['welkom'] = $_POST["Welkom-Bericht"];
$arrangement = $_SESSION['arrangement'] = $_POST["Arrangement-Bericht"];
$pas = $_SESSION['pas'] = $_POST["Maasduin-Actie-Bericht"];
$code = $_SESSION['code'] = $_POST['code'];
$email = $_SESSION['email'] = $_POST['email'];
$confrimActie = '1';
$found = FALSE;
$stmt = $conn->prepare("SELECT * FROM `ms-activiteiten` WHERE ActieCode = ? AND MaasduinEmail = ? AND Confirmed = ? ");
$stmt->bind_param("ssi", $code , $email, $Confirmed);
$stmt->execute();
$result = $stmt->get_result();
$stmt->close();
foreach ($hotels as $key => $hotel){
if ($code == $hotel['ActieCode'] && $email == $hotel['MaasduinEmail'] && $hotel['Confirmed'] == '1') {
$ActieVerify = $_SESSION['verifyActieCode'] = $confirmCodeVerifyActie = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), -10);
$naam = $hotel['MaasduinNaam'];
mkdir('image/' . $naam);
$destination1 = "image/" . $naam . "/" . $_FILES['image1']['name'];
$filename = $_FILES['image1']['tmp_name'];
move_uploaded_file($filename, $destination1);
mkdir('image/' . $naam);
$destination2 = "image/" . $naam . "/" . $_FILES['image2']['name'];
$filename = $_FILES['image2']['tmp_name'];
move_uploaded_file($filename, $destination2);
mkdir('image/' . $naam);
$destination3 = "image/" . $naam . "/" . $_FILES['image3']['name'];
$filename = $_FILES['image3']['tmp_name'];
move_uploaded_file($filename, $destination3);
mkdir('image/' . $naam);
$destination4 = "image/" . $naam . "/" . $_FILES['image4']['name'];
$filename = $_FILES['image4']['tmp_name'];
move_uploaded_file($filename, $destination4);
mkdir('image/' . $naam);
$destination5 = "image/" . $naam . "/" . $_FILES['image5']['name'];
$filename = $_FILES['image5']['tmp_name'];
move_uploaded_file($filename, $destination5);
$stmt = $conn->prepare("UPDATE `ms-activiteiten` SET MaasduinWelkom = ?, MaasduinArrangement = ?, MaasduinPasInfo = ?, Confirmcode = ?, MaasduinImgDialog1 = ?, MaasduinImgDialog2 = ?, MaasduinImgDialog3 = ?, MaasduinImgDialog4= ?, MaasduinImgDialog5 =? WHERE ActieCode = '$code'");
$stmt->bind_param("sssssssss", $welkom, $arrangement, $pas, $ActieVerify, $destination1, $destination2, $destination3, $destination4, $destination5);
$stmt->execute();
$stmt = $conn->prepare("UPDATE `ms-overnachten` SET MaasduinWelkom = ?, MaasduinArrangement = ?, MaasduinPasInfo = ?, Confirmcode = ?, MaasduinImgDialog1 = ? WHERE ActieCode = '$code'");
$stmt->bind_param("sssssssss", $welkom, $arrangement, $pas, $ActieVerify, $destination);
$stmt->execute();
$stmt = $conn->prepare("UPDATE `ms-etenendrinken` SET MaasduinWelkom = ?, MaasduinArrangement = ?, MaasduinPasInfo = ?, Confirmcode = ?, MaasduinImgDialog1 = ? WHERE ActieCode = '$code'");
$stmt->bind_param("sssssssss", $welkom, $arrangement, $pas, $ActieVerify, $destination);
$stmt->execute();
header("LOCATION: test.php");
}elseif (!$found && $code !== $hotel['ActieCode'] && $email !== $hotel['MaasduinEmail'] && $hotel['Confirmed'] == '1') {
$error = "<b>".'ERROR: ' . "</b>" . 'Code and email do not match!';
$found = TRUE;
}elseif(!$found && $code == $hotel['ActieCode'] && $email == $hotel['MaasduinEmail'] && $hotel['Confirmed'] == '0'){
$error = "<b>".'ERROR: ' . "</b>" . 'Accommodatie is nog niet geaccepteerd.';
$found = TRUE;
}
}