我正在使用mail()
in php 并想知道是否可以包含事件侦听器。下面包括带有一个按钮的代码,当单击该按钮时,该段落会向上滑动。然而,什么也没有发生。
<html>
<head>
<script type="text/javascript"src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type='text/javascript'>
$(function() {
$(':button').click(function(){
$("p").slideToggle();
});
});
</script>
</head>
<body>
<?php
$to = "Example@yahoo.com";
$subject = "Maybe so??";
$body = "<p>Yeppir </p>
<button>Click Me </button>";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: skywalker@msn.com';
if (mail($to, $subject, $body, $headers)) {
echo("<p>Message sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>
</body>
</html>