How to Send AMP Form Data to Email or Text File in WordPress?2019 Community Moderator ElectionAMP Form to work with PhPSending email in .NET through GmailHow to validate an email address in JavaScript?How to validate an email address using a regular expression?Amp-form does not redirect to another pageAmp form submission header errorAMP FORM Error: Response must contain the AMP-Access-Control-Allow-Source-Origin headerAMP Form In Rails 5.1 AppAMP-Form Returned AMP-Access-Control-Allow-Source-Origin is not equalHow to fix contact form errors on submit in AMP?Wordpress Form action doesn't work with AMP
Why doesn't using two cd commands in bash script execute the second command?
How can you use ICE tables to solve multiple coupled equilibria?
Opacity of an object in 2.8
Brexit - No Deal Rejection
Is it possible to upcast ritual spells?
Audio processing. Is it possible to directly access the decoded audio data going into the analog input of a computer
Interplanetary conflict, some disease destroys the ability to understand or appreciate music
How to make healing in an exploration game interesting
Charles Hockett - 'F' article?
What's causing this power spike in STM32 low power mode
It's a yearly task, alright
In a future war, an old lady is trying to raise a boy but one of the weapons has made everyone deaf
How to deal with taxi scam when on vacation?
The difference between「N分で」and「後N分で」
SOQL: Populate a Literal List in WHERE IN Clause
My Graph Theory Students
how to write formula in word in latex
How to write cleanly even if my character uses expletive language?
Life insurance that covers only simultaneous/dual deaths
Use of undefined constant bloginfo
Have researchers managed to "reverse time"? If so, what does that mean for physics?
Is it normal that my co-workers at a fitness company criticize my food choices?
What do Xenomorphs eat in the Alien series?
Why did it take so long to abandon sail after steamships were demonstrated?
How to Send AMP Form Data to Email or Text File in WordPress?
2019 Community Moderator ElectionAMP Form to work with PhPSending email in .NET through GmailHow to validate an email address in JavaScript?How to validate an email address using a regular expression?Amp-form does not redirect to another pageAmp form submission header errorAMP FORM Error: Response must contain the AMP-Access-Control-Allow-Source-Origin headerAMP Form In Rails 5.1 AppAMP-Form Returned AMP-Access-Control-Allow-Source-Origin is not equalHow to fix contact form errors on submit in AMP?Wordpress Form action doesn't work with AMP
MY Webpage with Form
I don't get any console errors when I fill the form in, but it seems that nothing happens? No data is collected.
My site is AMP and in Native mode. Can you use an email handler with AMP Forms?
Code is as follows:
?>php
if(!empty($_POST))
$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://gossiplolly.com') .".cdn.ampproject.org");
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://gossiplolly.com");
header("Access-Control-Expose-Headers: AMP-Redirect-To, AMP-Access-Control-
Allow-Source-Origin");
echo json_encode(array('successmsg'=>'data post'));
exit;
HTML
<form method="post" target="_top">
<fieldset><input name="name" required="" type="text" placeholder="Name" />
<input name="email" required="" type="email" placeholder="Email" />
<textarea name="message" placeholder="Message..."></textarea>
<input type="submit" value="Submit" />
<input id="GDPR" name="GDPR" required="" type="checkbox" value="GDPR" />
<label for="GDPR">I consent to this website storing my submitted
information.</label>
</fieldset>
</form>
php wordpress email amp-html amp-form
add a comment |
MY Webpage with Form
I don't get any console errors when I fill the form in, but it seems that nothing happens? No data is collected.
My site is AMP and in Native mode. Can you use an email handler with AMP Forms?
Code is as follows:
?>php
if(!empty($_POST))
$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://gossiplolly.com') .".cdn.ampproject.org");
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://gossiplolly.com");
header("Access-Control-Expose-Headers: AMP-Redirect-To, AMP-Access-Control-
Allow-Source-Origin");
echo json_encode(array('successmsg'=>'data post'));
exit;
HTML
<form method="post" target="_top">
<fieldset><input name="name" required="" type="text" placeholder="Name" />
<input name="email" required="" type="email" placeholder="Email" />
<textarea name="message" placeholder="Message..."></textarea>
<input type="submit" value="Submit" />
<input id="GDPR" name="GDPR" required="" type="checkbox" value="GDPR" />
<label for="GDPR">I consent to this website storing my submitted
information.</label>
</fieldset>
</form>
php wordpress email amp-html amp-form
Have you tried to debug your code using developer's console tool? You can check your code logic if it is running smoothly line-by-line. Check this documentation for more details.
– jess
Mar 7 at 14:10
I seem to have sorted it now thanks. The same guy I got the code from - Bachcha Sing - is a legend. He posted similar code elsewhere, but with the extra email section. stackoverflow.com/questions/43729564/amp-form-to-work-with-php Thanks for your advice!
– David Elstob
Mar 7 at 20:42
That's cool. Glad you have solved your issue.
– jess
Mar 8 at 8:01
add a comment |
MY Webpage with Form
I don't get any console errors when I fill the form in, but it seems that nothing happens? No data is collected.
My site is AMP and in Native mode. Can you use an email handler with AMP Forms?
Code is as follows:
?>php
if(!empty($_POST))
$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://gossiplolly.com') .".cdn.ampproject.org");
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://gossiplolly.com");
header("Access-Control-Expose-Headers: AMP-Redirect-To, AMP-Access-Control-
Allow-Source-Origin");
echo json_encode(array('successmsg'=>'data post'));
exit;
HTML
<form method="post" target="_top">
<fieldset><input name="name" required="" type="text" placeholder="Name" />
<input name="email" required="" type="email" placeholder="Email" />
<textarea name="message" placeholder="Message..."></textarea>
<input type="submit" value="Submit" />
<input id="GDPR" name="GDPR" required="" type="checkbox" value="GDPR" />
<label for="GDPR">I consent to this website storing my submitted
information.</label>
</fieldset>
</form>
php wordpress email amp-html amp-form
MY Webpage with Form
I don't get any console errors when I fill the form in, but it seems that nothing happens? No data is collected.
My site is AMP and in Native mode. Can you use an email handler with AMP Forms?
Code is as follows:
?>php
if(!empty($_POST))
$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://gossiplolly.com') .".cdn.ampproject.org");
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://gossiplolly.com");
header("Access-Control-Expose-Headers: AMP-Redirect-To, AMP-Access-Control-
Allow-Source-Origin");
echo json_encode(array('successmsg'=>'data post'));
exit;
HTML
<form method="post" target="_top">
<fieldset><input name="name" required="" type="text" placeholder="Name" />
<input name="email" required="" type="email" placeholder="Email" />
<textarea name="message" placeholder="Message..."></textarea>
<input type="submit" value="Submit" />
<input id="GDPR" name="GDPR" required="" type="checkbox" value="GDPR" />
<label for="GDPR">I consent to this website storing my submitted
information.</label>
</fieldset>
</form>
php wordpress email amp-html amp-form
php wordpress email amp-html amp-form
edited Mar 7 at 7:55
Vadim Kotov
4,75163549
4,75163549
asked Mar 6 at 19:46
David ElstobDavid Elstob
61
61
Have you tried to debug your code using developer's console tool? You can check your code logic if it is running smoothly line-by-line. Check this documentation for more details.
– jess
Mar 7 at 14:10
I seem to have sorted it now thanks. The same guy I got the code from - Bachcha Sing - is a legend. He posted similar code elsewhere, but with the extra email section. stackoverflow.com/questions/43729564/amp-form-to-work-with-php Thanks for your advice!
– David Elstob
Mar 7 at 20:42
That's cool. Glad you have solved your issue.
– jess
Mar 8 at 8:01
add a comment |
Have you tried to debug your code using developer's console tool? You can check your code logic if it is running smoothly line-by-line. Check this documentation for more details.
– jess
Mar 7 at 14:10
I seem to have sorted it now thanks. The same guy I got the code from - Bachcha Sing - is a legend. He posted similar code elsewhere, but with the extra email section. stackoverflow.com/questions/43729564/amp-form-to-work-with-php Thanks for your advice!
– David Elstob
Mar 7 at 20:42
That's cool. Glad you have solved your issue.
– jess
Mar 8 at 8:01
Have you tried to debug your code using developer's console tool? You can check your code logic if it is running smoothly line-by-line. Check this documentation for more details.
– jess
Mar 7 at 14:10
Have you tried to debug your code using developer's console tool? You can check your code logic if it is running smoothly line-by-line. Check this documentation for more details.
– jess
Mar 7 at 14:10
I seem to have sorted it now thanks. The same guy I got the code from - Bachcha Sing - is a legend. He posted similar code elsewhere, but with the extra email section. stackoverflow.com/questions/43729564/amp-form-to-work-with-php Thanks for your advice!
– David Elstob
Mar 7 at 20:42
I seem to have sorted it now thanks. The same guy I got the code from - Bachcha Sing - is a legend. He posted similar code elsewhere, but with the extra email section. stackoverflow.com/questions/43729564/amp-form-to-work-with-php Thanks for your advice!
– David Elstob
Mar 7 at 20:42
That's cool. Glad you have solved your issue.
– jess
Mar 8 at 8:01
That's cool. Glad you have solved your issue.
– jess
Mar 8 at 8:01
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55031093%2fhow-to-send-amp-form-data-to-email-or-text-file-in-wordpress%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55031093%2fhow-to-send-amp-form-data-to-email-or-text-file-in-wordpress%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you tried to debug your code using developer's console tool? You can check your code logic if it is running smoothly line-by-line. Check this documentation for more details.
– jess
Mar 7 at 14:10
I seem to have sorted it now thanks. The same guy I got the code from - Bachcha Sing - is a legend. He posted similar code elsewhere, but with the extra email section. stackoverflow.com/questions/43729564/amp-form-to-work-with-php Thanks for your advice!
– David Elstob
Mar 7 at 20:42
That's cool. Glad you have solved your issue.
– jess
Mar 8 at 8:01