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

Can't find variable: document ReactNative Js2019 Community Moderator ElectionReactNative: how to center text?Can't find variable: navigate - ReactNative navigationReact Native error: “Can't find variable: TouchableHighlight”How to use Expo.DocumentPicker.getDocumentAsync properly. [Expo] [ReactNative]Can't find variable: regeneratorRuntime (ReactNative)Reactnative Expo It is advisable for a StartUp?Can't find variable : Self / Can't install firebaseNPM Install Error in installing ReactNative CLIContacts Displaying in App using ReactnativeFacebook login error: can't find variable: Alert

Posting a File and Associated Data to a RESTful WebService preferably as JSON2019 Community Moderator ElectionREST URI convention - Singular or plural name of resource while creating itUploading both data and files in one form using Ajax?How do I upload a file with metadata using a REST web service?REST API - file (ie images) processing - best practicesSpring: JSON data and file in the same requestREST API Put large dataPosting a file and JSON data to Spring rest serviceRESTful Web Service Upload/Download Large Data With JSONREST API Design sending JSON data and a file to the api in same requestPost JSONArray to REST servicePUT vs. POST in RESTParsing values from a JSON file?JavaScript/jQuery to download file via POST with JSON dataHow do I upload a file with metadata using a REST web service?How to POST JSON data with Curl from Terminal/Commandline to Test Spring REST?Separate REST JSON API server and client?what's the correct way to send a file from REST web service to client?How do I write JSON data to a file?What is “406-Not Acceptable Response” in HTTP?REST API - file (ie images) processing - best practices