Forum Moderators: coopster
$this->body .="<td><textarea name=description cols=30 rows=10 onkeypress="textCounter(this,this.form.counter,430)";>".urldecode($class_ad->DESCRIPTION)."</textarea>\n";
$this->body .="<input type=text name=counter maxlength=3 size=3 value=430 onblur="textCounter(this.form.counter,this,255);">Characters remaining if neded.</td></tr>\n";
$this->body .="<td><textarea name=description cols=30 rows=10
onkeypress=\"textCounter(this,this.form.counter,430)\";>"
.urldecode($class_ad->DESCRIPTION)."</textarea>\n";
$description = (isset($_POST['description])) ? $_POST['description] : '';
$descMax = 255;
if (strlen($description) > $descMax) {
// handle the tampered description field issue
}
Server-side? You will want to do this anyway, since client-side entries can be manipulated and bypassed. Especially consider if they have javascript turned off in their browser! To check server-side, just see if there is anything in the $_POSTed variable:
$description = (isset($_POST['description]))? $_POST['description] : '';
if (!$description) {
// handle the error
}
$descMax = 255;
if (strlen($description) > $descMax) {
// handle the tampered description field issue
}