简体   繁体   中英

AMP form submission into database

Form Submission using Amp template is not working, I can't post data from amp-form by using php .Simply No action is getting performed. How to fix it? Mypage: http://samiakhalil.com/theinfotime/amp/register1.php

<?php
if (isset($_POST['register'])) {
    $name = $_POST['name'];
    $email = $_POST['email'];
    echo $name;
}
?>
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script> 
<form method="post"
action-xhr="https://ampbyexample.com/components/amp-form/submit-form-input-text-xhr"
target="_top">
    <input type="text" class="data-input" name="name" placeholder="Name" required>
    <input type="email" class="data-input" name="email" placeholder="Email" required>
    <input type="submit" value="Register" name="register" class="button button-primary">
</form>

add

<input type="hidden" name="register" value="a">

button name is empty, i dont know

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