Need more validation field, how to escape ' in db

kleeflang 28 Mar, 2008
Hello all,

I have two questions on validation.
1. I use a lot of fields, now there isn't enough room in the admin to fill them al in the not-blank validation. Is there a way to expand this?
2. If a user input has a ' the form doesn't get saved to the db. The e-mail is fine though (\'), is there a way to filter out the ' before it's send to the db?

Thanks,

Krijn
GreyHead 29 Mar, 2008
Hi Krijn,

1) You need to look for a block of code like this in admin.chronocontact.html.php:
<tr>
  <td><?php echo mosToolTip( REQUIRED_TT ); ?></td>
  <td><strong>1 - <?php echo REQUIRED; ?></strong> </td>
  <td></td>
  <td>
    <input type="text" name="params[val_required]" id="params[val_required]" class="inputbox" size="50" maxlength="500" value="<?php echo $paramsvalues->val_required; ?>">
  </td>
 </tr>
You can change the maxlength value to something bigger (looks as though I've already edited this one from CF for Joomal 1.0.x

2) in the Autogenerated tab replace $_POST['fieldname'] with addslashes($_POST['fieldname']) I think that should do it.

Bob<br><br>Post edited by: GreyHead, at: 2008/03/29 00:02
This topic is locked and no more replies can be posted.