好的,我需要将此联系表突出显示为红色,并在框中说无效!无论我做什么,我都无法让它发挥作用!我无法更改已经存在的 HTML 标签,您可以将其添加到 HTML 但不能删除任何标签,但我希望它与 JavaScript 显示在同一页面上,并且看起来非常好,有人可以编辑我拥有的内容并提供帮助请让我完成这项工作!
哦,我每次测试时都会收到 2 封电子邮件!
这是HTML:
<!-- Contact -->
<div class="wrapper wrapper-style4">
<article id="contact">
<header>
<h2>Want to hire me? Get in touch!</h2>
<span>I do quality work and would love to work for you!.</span>
</header>
<div>
<div class="row">
<div class="12u">
<div id="errors"></div>
<form method='post' action='mailform.php' id='contact-form'>
<div>
<div class="row half">
<div class="6u">
<input type="text" name="name" id="name" placeholder="Name" />
</div>
<div class="6u">
<input type="text" name="email" id="email" placeholder="Email" />
</div>
</div>
<div class="row half">
<div class="12u">
<input type="text" name="subject" id="subject" placeholder="Subject" />
</div>
</div>
<div class="row half">
<div class="12u">
<textarea name="message" id="message" placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<a href="#" class="button form-button-submit">Send Message</a>
<a href="#" class="button button-alt form-button-reset">Clear Form</a>
</div>
</div>
</div>
</form>
</div>
</div>
<!-- Contact -->
<div class="wrapper wrapper-style4">
<article id="contact">
<header>
<h2>Want to hire me? Get in touch!</h2>
<span>I do quality work and would love to work for you!.</span>
</header>
<div>
<div class="row">
<div class="12u">
<div id="errors"></div>
<form method='post' action='mailform.php' id='contact-form'>
<div>
<div class="row half">
<div class="6u">
<input type="text" name="name" id="name" placeholder="Name" />
</div>
<div class="6u">
<input type="text" name="email" id="email" placeholder="Email" />
</div>
</div>
<div class="row half">
<div class="12u">
<input type="text" name="subject" id="subject" placeholder="Subject" />
</div>
</div>
<div class="row half">
<div class="12u">
<textarea name="message" id="message" placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<a href="#" class="button form-button-submit">Send Message</a>
<a href="#" class="button button-alt form-button-reset">Clear Form</a>
</div>
</div>
</div>
</form>
</div>
</div>
我需要这里的 JavaScript:
<script>
</script>
PHP表单在这里:
<?php
$to = "bcw1995@gmail.com";
$subject = $_REQUEST['subject'];
$message = $_REQUEST['message'];
$from = $_REQUEST['email'];
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail($_REQUEST['email'], $subject,
$message, "From:" . $email);
}
header("Location: http://www.thorbis.com/#contact");
?>
有人可以解决这个问题,您将成为救生员!