MySQL Forums
Forum List  »  PHP

Text box security
Posted by: David Simpson
Date: February 06, 2011 12:30AM

Hey guys. I put an about me text in the register portion of a website. I want to know if this is good enough security for it.The text box:

<p>About Me:
<textarea type="textbox" name="aboutme" cols="60" rows="5" maxlength="160" value="<?php if (isset($trimmed['aboutme'])) echo $trimmed['aboutme']; ?>"></textarea></p>

I'm using this to clean it:

if (preg_match ('/^[0-9A-Za-z \'.-]{0,160}$/i', $trimmed['aboutme'])) {
$fantasy = mysqli_real_escape_string ($dbc, $trimmed['aboutme']);

It's going into the database, and it's not a required field.

Thank you very much :)

Options: ReplyQuote

Written By
Text box security
February 06, 2011 12:30AM
February 08, 2011 11:02AM
February 08, 2011 02:27PM
February 10, 2011 03:10AM
February 08, 2011 06:57PM
February 08, 2011 07:49PM
February 08, 2011 08:21PM
February 08, 2011 10:21PM
February 08, 2011 11:52PM
February 09, 2011 11:40AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.