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 header​AMP 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 header​AMP 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










1















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>









share|improve this question
























  • 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















1















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>









share|improve this question
























  • 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













1












1








1








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>









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived