PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a textarea and when the user enters info into the textarea, they can click anywhere in the box, how do I force the curser to the left. Also when the form is submitted, if there is no info entered into the box, it is submitted with spaces, so mySql shows that it is not null. I have tried stripslashes and trim......Help!!
Just let them type whatever they want in the textarea, spaces/nothing etc.. and trim() the posted var then check if it's empty() or not. E.g.
if(isset($_POST['r_experience'])){
$r_exp = trim($_POST['r_experience']);
if(!empty($r_exp)){
//it's been trimmed and it's not empty, can go in db
} else {
//it's empty so ignore inserting it
}
}