I have one question about my php form:
if (!isset($_REQUEST['email_address'])) {
header( "Location: $home_page" );
what does this do?
Does it do anything because it came with the source code I found to make my own:
<form method="post" action="send_mail.php">
<label><h4>Name</h4>
<input type="text" name="name" placeholder="Name not required..." maxlength="40">
</label>
<br>
<font size="3">
<label><h4>Comment</h4>
<textarea name="comment" minlength="10" maxlength="650" placeholder="Type your comment here.... " required oninvalid="this.setCustomValidity('Please type a comment with at least 10 characters.')" oninput="setCustomValidity('')"></textarea>
</label>
<br>
<button type="submit">Submit Comment</button>
<br>
</form>
<?php
$webmaster_email = "[email protected]";
$thankyou_page = "thank_you.html";
$error_page = "technical_error.html";
$home_page = "index.htm";
$name = $_REQUEST['name'] ;
$minlen = 10;
$comment = $_REQUEST['comment'] ;
if (empty($name)) { $name='Anonymous'; }
$msg = "rnName: " . $name . "rnrnComment: " . $comment . "rn";
if (!isset($_REQUEST['email_address'])) {
header( "Location: $home_page" );
}
if(strlen(trim($_POST['comment'])) < $minlen) {
header( "Location: $error_page" );
}
elseif($_SERVER['REQUEST_METHOD'] === 'POST'){
mail( "$webmaster_email", "Comment on Antarctica-UFO.com", $msg );
header( "Location: $thankyou_page" );
}
?>
I am sorry, I did not try much but I don’t know what to do.