what you were doing prior to this was getting the value of the string, not the length. strlen(n) looks for the number of characters in the string itself.

Duniyadnd

Wichetael

11-26-2002, 04:40 PM

It was already crossposted in the php forum and answered there.

0810

11-26-2002, 07:37 PM

Hi how are you doing?

I fixed like this

I tested many times this scirpt but whole messages come when I click submit button.

even though it is wrong, it goes my database.

what I want to do is that if fname and lanme don't have more than 4 characters ,it comes only this message.(not go to my database)

print("You firstname and lastname should be more than 4 characters.<br>\n");

if password has no more than 4 characters and password is not equal to confirm, it comes only this message.(not go to my database).

print("Password and Confirm are not right,<br>go back to sign up again<br>\n");
print("your password should be more than 4 characters.<br>\n");
print("<a href=\"sign.php\">Here sign up again please!</a>");

if it is true everything, it goes that datas to my database, then it comes only this message

print("<html><body background=\"image/kareha.gif\">");
print "Thank you for filling out my form.<br> <a href=\"Ja1test.php\">Click here</a> to go back to the homepage.<br>\n";
print("Now it is fall and soon coming winter<br>Time goes fast. ");
print("<center><img src=\"image/falltrees.gif\"></center>");
print("</body></html>");

duniyadnd

11-26-2002, 08:22 PM

okay, now you got the lengths of the entries. Now if you want to restrict what goes into the tables, it comes to a javascript solution, or you can try these around: