当邮箱中没有输入任何内容时,如何提示输入电子邮件?验证用户端输入的电子邮件的最简单方法是什么。
<?php
## CONFIG ##
# LIST EMAIL ADDRESS
$recipient = "test@test.com";
# SUBJECT (Subscribe/Remove)
$subject = "Subscribe";
# RESULT PAGE
$location = "index.html";
## FORM VALUES ##
# SENDER - WE ALSO USE THE RECIPIENT AS SENDER IN THIS SAMPLE
# DON'T INCLUDE UNFILTERED USER INPUT IN THE MAIL HEADER!
$sender = $recipient;
# MAIL BODY
$body .= "Email: ".$_REQUEST['Email']." \n";
# add more fields here if required
## SEND MESSGAE ##
mail( $recipient, $subject, $body, "From: $sender" ) or die ("Mail could not be sent.");
## SHOW RESULT PAGE ##
header( "Location: $location" );
?>
这是在html上的
<form action="subscribe.php" class="form-inline" method="POST">
<input class="form-control " name="Email" placeholder="Email" type="Email"/>
<button class="btn btn-default" type="submit" >
Request Info
</button>
</form>
LEATH
慕婉清6462132