This code is only a rough draft.
In using an if statement to check stringlength using the > operator breaks the whole code under it. Using < doesn't seem to bother it or other operators... i.e.
if ($string > 100) {
echo "You have over 100 characters. You must use fewer letters.";
exit;
}
all code follows...
$description=$POST["description"];
$username=$POST["username"];
$description = stripslashes($description);
$string = strlen($description);
if ($string > 100) { //THIS PART BREAKS THE CODE
echo "You have over 100 characters. You must use fewer letters.";
exit;
}
$method = getenv("request_method");
if ($method != "POST")
{
header("location:error.php?msg13");
echo $method;
exit;
}
if (eregi("[?;%'$*&]", $url)) {
header("location: change_info.html");
exit;
}
if (eregi("[?$%|()&*@!#]", $search))
{
header("Location: error.php?msg12");
exit;
}
$description = addslashes($description);
$dbh=mysql_connect ("localhost", "", "") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("shop");
$sql = "update sites set description = '$description' where username = '$username'";
$sql_result = mysql_query($sql)
or die(mysql_error());
MYSQL_CLOSE();