0

I finally got my html website working in an Azure App. Now I want to add a Contact Form. I have done a simple HTML form that calls the MailGun API but nothing happens when I click submit. There are no errors showing in the browser.

I followed the instructions here to create the form.

Kirsten
  • 15,730
  • 41
  • 179
  • 318
  • 1
    Those instructions reference submitting the form to send.php. Is PHP enabled for your Azure setup? Did you remember to change the api_key, api_domain, and send_to values? If PHP is enabled did you check the Azure error log? (I mention PHP twice since a "static" site implies no server-side scripting.) – Dave S Dec 19 '17 at 02:40
  • @DaveS I have set the keys. Also if I go into Application Settings I can see that the PHP version is 5.6 – Kirsten Dec 19 '17 at 03:09
  • I can see some trace files in Kudu Debug Console Is that where I look for logs? – Kirsten Dec 19 '17 at 03:13
  • I haven't used PHP with Azure yet, so you'll need to ask someone else or google that. You might try adding error reporting to the top of send.php - https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display – Dave S Dec 19 '17 at 03:15
  • Thanks. Just adding the index.php and php.ini did not seem to work., investigating https://blogs.msdn.microsoft.com/silverlining/2012/10/16/getting-error-info-for-php-sites-in-windows-azure-web-sites/ – Kirsten Dec 19 '17 at 03:29
  • https://stackoverflow.com/questions/3062324/what-is-curl-in-php – Kirsten Dec 19 '17 at 06:43
  • 1
    Is your issue resolved? If not, you can edit your question adding more details for further analysis. [How to debug PHP in MS Azure](https://stackoverflow.com/questions/33241711/how-to-debug-php-in-ms-azure/33276962#33276962) – Aaron Chen Dec 21 '17 at 08:41

1 Answers1

0

It turned out that I had incorrect settings in

  $api_key = 'INSERT_API_KEY_HERE';
  $api_domain = 'INSERT_DOMAIN_HERE'; 
  $send_to = 'YOUR_EMAIL';

This became apparent after displaying the error from the Ajax call. As explained here

Kirsten
  • 15,730
  • 41
  • 179
  • 318