AMP表单提交到数据库中

时间:2017-01-25 05:37:26

标签: php forms amp-html

使用Amp模板的表单提交不起作用,我无法使用php发布来自放大器的数据。仅仅没有执行任何操作。怎么解决? 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>

1 个答案:

答案 0 :(得分:0)

添加

MyComponent

按钮名称为空,我不知道