我有一個(gè)帶有 amp-form 組件的 AMP 網(wǎng)站,但由于某種原因無(wú)法提交表單??刂婆_(tái)錯(cuò)誤https://prnt.sc/shu7i0和網(wǎng)絡(luò)錯(cuò)誤https://prnt.sc/shu85g。您還可以在此處查看實(shí)時(shí)網(wǎng)站https://frontlinewebtech.com/traderharian/。請(qǐng)幫忙這是我的 html<form class="subscribe-form flex flex-middle" method="POST" action-xhr="/mail.php" target="_top"> <div class="form-control"> <input type="email" required name="email" placeholder="Alamat email"> </div> <button class="btn-subscribe" type="submit">Daftar</button></form>這是我的 PHP<?phpif(!empty($_POST)){ $email = $_POST['email']; $formcontent=" From: $email"; $recipient = "bishnu051@gmail.com"; $subject = "email from website"; $mailheader = "From: $email \r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("Error!"); $domain_url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]"; header("Content-type: application/json"); header("Access-Control-Allow-Credentials: true"); header("Access-Control-Allow-Origin: ". str_replace('.', '-','https://frontlinewebtech.com/')); header("AMP-Access-Control-Allow-Source-Origin: " . $domain_url); header("Access-Control-Expose-Headers: AMP-Access-Control-Allow-Source-Origin"); header("AMP-Redirect-To: https://example.com/index.html"); header("Access-Control-Expose-Headers: AMP-Redirect-To, AMP-Access-Control-Allow-Source-Origin"); echo json_encode(array('name' => $name)); exit;}?>
我有一個(gè) AMP 表單,但由于某種原因,它在提交時(shí)出錯(cuò)
夢(mèng)里花落0921
2023-03-26 16:00:01