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
Could you please stop shuffling the deck and play already?
What wound would be of little consequence to a biped but terrible for a quadruped?
Why does the negative sign arise in this thermodynamic relation?
Is "history" a male-biased word ("his+story")?
Do f-stop and exposure time perfectly cancel?
Fourth person (in Slavey language)
PTIJ: Why can't I eat anything?
Do items de-spawn in Diablo?
Examples of a statistic that is not independent of sample's distribution?
Does "variables should live in the smallest scope as possible" include the case "variables should not exist if possible"?
Are the terms "stab" and "staccato" synonyms?
Make a transparent 448*448 image
Space in array system equations
How did Alan Turing break the enigma code using the hint given by the lady in the bar?
Force user to remove USB token
What are some noteworthy "mic-drop" moments in math?
Accountant/ lawyer will not return my call
Making a sword in the stone, in a medieval world without magic
Subset counting for even numbers
infinitive telling the purpose
String reversal in Python
Should I tell my boss the work he did was worthless
Does a Catoblepas statblock appear in an official D&D 5e product?
Why is Beresheet doing a only a one-way trip?
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,73163549
4,73163549
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