Im looking for something that I could tell if someone entered
nothing but spaces into a form field.
right now I have a script that will cooperate if the form field is
entered empty, but if people enter spaces into the form field
(its for a tagbox) they can fuck it up.
This is my script:
<?php
$comment = $_REQUEST["comment"];
$commenttags = strip_tags("$comment");
if($commenttags == "")
{}
else
{
$commentfile = "comments.txt";
$commentarray = file("$commentfile");
$i = "0";
$comcount = "0";
while($i < 15)
{
$combuffer .= "$commentarray[$comcount]";
$comcount++;
$i++;
}
$commentnew = stripslashes(stripslashes("$commenttags\r\n$combuffer"));
$commentopen = fopen("$commentfile", "w");
fwrite($commentopen, "$commentnew");
}
?>
<head>
<META HTTP-EQUIV=Refresh CONTENT="0; URL=../index.php">
</head>
If people enter just one or more spaces into this thing, it runs
all the comments off, and it looks like somethings fucked up.