그래서 2 개의 버튼을 제출 했는데도 부러진 버튼에서 모든 코드를 제거하더라도 403 erorr은 금지되지만 두 번째 버튼은 작동합니다 ...2 제출 1 동일한 코드가 작동합니까?
여기 내 HTML/버튼 코드에 대한 PHP 코드입니다 : 버튼에 대한
<form action="buy.php?id=<?php echo $id; ?>" method="POST">
<input type="email" class="form-control" name="email" placeholder="Email" required>
<br>
<p></p>
<?php if($row['pp'] == 1){
echo '
<input type="submit" class="btn btn-primary" value="Pay with Paypal" name="pp">';
} ?>
<p></p>
<?php if($row['btc'] == 1){
echo '
<input type="submit" class="btn btn-info" value="Pay with Bitcoin" name="btc">';
} ?></form>
코드 : 깨진 버튼의 PP BTC 어디든지
if(isset($_POST['btc'])){
$email = htmlentities($_POST['email'], ENT_QUOTES);
$stmt = $db->prepare("INSERT INTO invoices (itemid, username, email, price, status, type) VALUES (:itemid, :username, :email, :price, :status, :type)");
$stmt->execute(array(':itemid' => $id, ':username' => $row['username'], ':email' => $email, ':price' => $row['price'], ':status' => "awaiting", ':type' => "btc"));
$id = $db->lastInsertId();
$stmt = $db->prepare("SELECT * FROM invoices WHERE id = :id");
$stmt->execute(array(':id' => $id));
$row2 = $stmt->fetch();
}
만 차이가있다.
이에서 나는 그나마 정말 당신이 쪽 버튼으로 제출하면 어떻게 것을 얻을. – Aschab
403 금지 된 액세스로 이동하지 않습니다. –
... db-queries와 쿼리 문자열에서 사용하는 입력 매개 변수 ('$ id','$ row'-array ect)는 어디에 선언합니까? 스 니펫이 아닌 관련 코드를 표시해야합니다. –