I am new to Google App engine, so stuck. I want to run a php script to process my form in google app engine. I am not sure how to go about it.
This is how I have defined the form:
<form method="post" action="/php/" name="SampleForm">
<input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER" />
<input id="TEST" type="text" name ="EmailAddr" class="text" value="Your email address" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Your email address';}">
<input type="hidden" name="subject" value="Sample FormMail Testing" />
<input type="hidden" name="recipients" value="helloworld@gmail.com" />
<input type="submit" value="Submit" />
</form>
and this is my app.yaml :
application: totemic-gravity-676
version: 1
runtime: php
api_version: 1
handlers:
- url: /(.*\.(gif|png|jpg|ico|js|css))
static_files: \1
upload: (.*\.(gif|png|jpg|ico|js|css))
- url: /robots.txt
static_files: robots.txt
upload: robots.txt
- url: /
script: main.php
- url: /php/
script: formmail.php
what my php script does is that it sends a mail to some email address. I have my formmail.php in the same level as app.yaml. But this does not work. The script can be accessed statically, but when I run it via the form, I get error messages. What could be the problem ?
you may check it in action here :http://totemic-gravity-676.appspot.com/ (scroll down to the update form)
I think I have do something with the -static keyword in my yaml, but I am clueless about how to define a folder as static
You're script is being called - looks like you're trying to use the mail() function that isn't supported on app engine.
from your app logs.
/formmail.php 200 350ms 0kb Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 module=default version=1
W 2014-08-25 19:32:57.768 The function 'mail' is not implemented.
W 2014-08-25 19:32:57.768 The function 'mail' is not implemented.
W 2014-08-25 19:32:58.046 The function 'mail' is not implemented.
to send mail on app engine using php