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

Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page