Hello I am trying to write a form that checks user mail address by existence of "@" character. I wrote these codes below but when I enter information at the html file I get this warning:
Notice: Use of undefined constant mail - assumed 'mail' in C:\xampp\test\send_simpleform.php on line 2
Can you please tell me why am I getting this notice? Thanks a lot. Here is the html file
<html>
<head>
<title>A simple HTML form</title>
</head>
<body>
<form action="send_simpleform.php" method="POST">
<p><strong>Name:</strong><br>
<input type="text" name="user"></p>
<p><strong>E-mail:</strong><br>
<input type="text" name="mail"></p>
<p><input type="submit" value="send"></p>
</form>
</body>
</html>
and this is the send_simpleform.php file's code:
<?php
if(strstr($_POST[mail],"@")){
echo "<p>Welcome <b>$_POST[user]</b>!</p>";
//echo "<p>Your message is:<br><b>$_POST[message]</b></p>";
}
else
echo"<p>Your e-mail address seems invalid. Please go back and enter a valid address.</p>"
?>
Thank you very much