Hi, I want to echo something if certain text is typed into a form textbox.
<form action="mail.php" method="POST">
<table border="0">
<tr><td><b>To:</b></td><td><input type="text" name="mailTo" size="20" value="<? ; ?>"></td></tr>
<tr><td><b>Subject:</b></td><td><input type="text" name="mailSubject" size="20" value="<?=$mailSubject;?>"></td></tr>
</table>
<b>Message:</b><br>
<textarea rows='16' cols='45' name='mailMessage'></textarea><br>
<input type="submit" name="mailAction" value="Send" />
</form>
I want to add it to the 'To' row. So, if someone types their username into the 'To' column, then it echo's 'You can't mail yourself'.
This code displays the username:
<?php (!$session->username) ?>
Something like this:
<? if $mailTo = $session->username) {
echo "Can't send mail to yourself!";
exit; } ?>
Please could someone kindly help me. Thank You.