我对网络编程很陌生,正在尝试建立一个个人网站并运行。我有一个联系表格,似乎没有执行任何操作。我已经在网上寻找代码中的错误,但我碰壁了。
标题中的脚本
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://html5form.googlecode.com/svn/trunk/jquery.html5form-1.5-min.js"></script>
html5表单
<form action="message.php" method="post" id="message_form">
<fieldset>
<input type="email" name="email" id="email" title="Email address" maxlength="40" placeholder="Email Address" autocomplete="off" required />
<br />
<input type="text" name="subject" id="subject" title="Subject" maxlength="60" placeholder="Subject" autocomplete="off" required />
<br />
<textarea name="message" id="message" title="Message" cols="30" rows="5" maxlength="1000" placeholder="Message" required></textarea>
<br />
<input type="submit" value="Send" id="submit" name="submit"/>
</fieldset>
</form>
正文中的脚本(链接)
$('#message_form').html5form({
allBrowsers : true,
responseDiv : '#response',
messages: 'en',
messages: 'es',
method : 'GET',
colorOn :'#0d85a5',
colorOff :'#d2d2d2'
});
消息.php
<?php
if ('POST' === $_SERVER['REQUEST_METHOD']) {
$to = "rbblakeley@gmail.com";
$from = "r.blakeley@yahoo.com";
$subject = "test subject";
$message = "test message";
$body = "$from\n $message";
echo "Your message has been sent!";
mail($to, $subject, $body);
} else {
echo "Rapscallions! Please try again.";
}
?>
在本地 MAMP 服务器上进行测试并上传到我的远程主机(bluehost),当我点击“发送”时没有任何反应,除了表单重置为占位符值。帮助。