ashley98860615 wrote:i tried using htmlentities but i can't get it to work, i've tried two ways - one before my sql outside an if statement and oneinside the if statement, both let me put numbers in.
Ashley,
Why don't you read what the htmlentities() function does and doesn't do here: http://www.php.net/htmlentities
In a nutshell, if you want to stop users from entering numbers, you will typically do this using regular expressions. You will need to look at the ereg() functions: http://www.php.net/ereg
ashley98860615 wrote:i am also having troubles checking whether form feilds are filled out..
You are checking to see if they are set, which is good, but you are not checking to see if they have a value. The problem is, if the form fields are on the form, but the user doesn't fill out a value in them and submits the form, they will be set. They won't, however, have any values associated with them: Their values will be empty. You can check for this a couple of different ways, using the strlen() function, the empty() function, etc. Another way is to change this line of code:
if(!isset($firstname) || !isset($lastname) || !isset($email)) {
to this:
if(trim($firstname) == '' || trim($lastname) == '' || trim($email) == '') {