I want to send data from the input form to the server (or mail) but I get an error.

Asked 2 years ago, Updated 2 years ago, 43 views

On a common screen, I would like to send the data I entered in the input form with the Send button, but when I debug it on the actual machine, I get an error message: file:///data/data/mobi.monaca.debugger/file/projects/cloud/.../wwww/mail.php. Is there anything I can set up?
(Code below)

<!DOCTYPE HTML>
<html lang="ja">
<metacharset="UTF-8">
<body>
<form action="mail.php" method="post">
<p><label>Name:<input type="text" name="name" size="40"></label></p>
<p>label>Comments:<br><textarea name="comments" rows="2"cols="40"></textarea></label></p>
<p><input type="submit" value="send"><input type="reset" value="reset" value &"reset">>/p>
</form>
</body>
</html>

monaca html5

2022-09-29 22:18

1 Answers

The action attribute is specified in the relative URL, so you are trying to send it to mail.php on the debugger.

mail.php should work if you upload it to the location where it is located, but if you want to run it on the debugger, you must specify the action attribute in the absolute URL, such as http://hogehoge.com/mail.php.


2022-09-29 22:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.