I have a check for max letters. If the check is not true the first time, its working. But if i have a insert with 200 characters or more it always returns Message cant have more than 200 characters. Even with 10 characters after the test return error. Can't see what I'm doing wrong.
<?php
$stripped = mysql_real_escape_string($_GET['id']);
$id = mysql_real_escape_string($_GET['id']);
$message = mysql_real_escape_string($_POST['message']);
$aktiv = mysql_real_escape_string($_POST['aktiv']);
if(isset($_POST['sendmsg']))
{
if ($_POST['message'] < 200)
{
echo "Message can't be more than 200 characters";
}
else {
$result = mysql_query("UPDATE cms_prosjekt SET message = '$message', active_msg = '$aktiv' WHERE id = $stripped;");
header('Location: Location: /index.php?url=projectedit&id='.$stripped.'&code='.$id.'');
exit;
}
}
?>
Aucun commentaire:
Enregistrer un commentaire