I'm trying to put some security on 'Send email form'. So I need to detect any new line characters in $subject.
The code I'm using doesn't give any results.
<?php
$subject = $_POST['Subject'];
if(empty/COLOR)
{
echo '<form method="post" action="">
<input type="text" name="Subject" size="20" />
<input type="submit" value="Submit" />
</form>';
}else{
if (eregi("\r", $subject) || eregi("\n", $subject)) {die("new line found");}
echo "CLEAR";
}
?>
Using other scripts for this purpose gives me the same.
Seems like the problem lies in $_POST because if I state directly - $subject = "try";
everything works perfectly.
I'd appreciate if anyone can help.
Thanks.