Complete newbie guess Should
if (strlen($cpassword)<5 || strlen($cpassword >16)) not be if (strlen($cpassword)<5 || strlen($cpassword)>16) ? "Anitha Paruchuri" To: [EMAIL PROTECTED] <[EMAIL PROTECTED] cc: .niu.edu> Subject: [wdvltalk] Re: PHP Question 13/01/2004 19:10 Please respond to wdvltalk The code where it does this is here-- if (strlen($cpassword)<5 || strlen($cpassword >16)) { echo "Your password must be between 5 and 16 characters. Please go back and try again."; exit; // check password length is ok } I tried printing the values of strlen before the if statement and it does give me 6 for the length of 123abc but it also gives me the error message saying "Your password must be....." I now realize that this is not the strlen problem. But What else could be going wrong here?. I am checking that the user password is between 5 and 16 characters in length. In this example if it is 6 it shouldn't be printing the message, but it does. Anitha >>> [EMAIL PROTECTED] 1/13/2004 11:50:16 AM >>> Anitha Paruchuri wrote: > Hi, > I am trying to check the length of the password entered by the user > using strlen($password). It works fine when say I enter a password as > 'abc123' but if I entered '123abc' it somehow doesn't work fine. Am I > missing something here? Should the $password or the variable for the > function strlen() cannot start with a number?? > Strings can be all digits. Do you have a sample of the code that doesn't work? I've tested this and can't recreate the problem. Here's my test script: http://demo.fenelon.us/testCode/strlen_test.php?test3=43434 Change the value for test3 to try different strings. Sheila ____ * The WDVL Discussion List from WDVL.COM * ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To set a personal password send an email to [EMAIL PROTECTED] with the words: "set WDVLTALK pw=yourpassword" in the body of the email. To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% To unsubscribe via postal mail, please contact us at: Jupitermedia Corp. Attn: Discussion List Management 475 Park Avenue South New York, NY 10016 Please include the email address which you have been contacted with. ____ ? The WDVL Discussion List from WDVL.COM ? ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To set a personal password send an email to [EMAIL PROTECTED] with the words: "set WDVLTALK pw=yourpassword" in the body of the email. To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] To unsubscribe via postal mail, please contact us at: Jupitermedia Corp. Attn: Discussion List Management 475 Park Avenue South New York, NY 10016 Please include the email address which you have been contacted with. john.f.hughes Goodbody Stockbrokers Private Clients Ballsbridge Park + 353 1 6416048 This information is confidential and may be privileged. It is intended solely for the addressee. Access to this e-mail by any other person (except any person authorised by the addressee to deliver this message to him and only for that purpose) is unauthorised. If you are not the addressee you are prohibited from disclosing its content, copying it or distributing it otherwise than to the addressee. Please notify us immediately if you received this e-mail and you are not the addressee and did not receive it to pass to the addressee. If you are not the addressee of this e-mail you should not place any reliance on its contents. If you e-mail information to us or receive e-mail from us you should be aware that we cannot give any assurance about the security or confidentiality of any e-mail. We cannot accept responsibility for any loss which may arise to any person as a direct or indirect result of all or any part of any e-mail becoming known by anyone other than the recipient. This Disclaimer has been generated by CMDis ____ • The WDVL Discussion List from WDVL.COM • ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To set a personal password send an email to [EMAIL PROTECTED] with the words: "set WDVLTALK pw=yourpassword" in the body of the email. To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] To unsubscribe via postal mail, please contact us at: Jupitermedia Corp. Attn: Discussion List Management 475 Park Avenue South New York, NY 10016 Please include the email address which you have been contacted with.