Jump to content

dalawh

Members
  • Posts

    127
  • Joined

  • Last visited

Everything posted by dalawh

  1. So when ^ is inside [], it means not and when ^ is outside of [], it means the start? Without the i modifier, it will only accept the domain and tld in capitals right? Oh. What I mean was, was it better to use [A-Z] and true means valid email or [^A-Z] and false means valid email. Pretty much the same, but different ways of looking at it. I realized that the way mentioned was better.
  2. Still in need of help from the generous members of the community
  3. Thanks for the site. I think I will use this on: ^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$It seems to be the most accurate/useful one. Does the ^ apply to the whole expression or just the first []? I would assume the first []. On the site, it said: I may be misreading this, but does it say to use i as a modifier instead of adding a-z? If that is true, doesn't that affect the domain and tld meaning when I use test, it will always come back true since the domain and tld will always contain letters? When you use test function with the above expressions, how does it work? Does it only return one true/false or one for each of the []? For the domain and tld, wouldn't it be better to use ^ to prevent unwanted characters?
  4. I was looking through some ways to validate email. I saw the one on w3schools, but that is a basic one, so I started to code something more complicated adding all those if, else if, else statements, etc. Then I came across this... function validateEmail(email){var allowed=/^([a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$)/; return allowed.test(email);} Is something that simple sufficient enough? Everything seems to look as if it would work. Also, what does the "$" do?
  5. Oooo, did not know this. Thanks for this
  6. Oh stupid me. Thanks a lot for the help.
  7. I went over this plenty of times and no matter how many times I go over it, something goes wrong and I can't seem to figure it out. function validateEmail(email){var atNum=0;for(var i=0; i<email.length; i++){ //Checks for number of @ if(email.charAt(i)=="@"){ atNum++; }}alert("atNum: " + atNum);var atPos=email.indexOf("@");alert("atPos: " + atPos);var lastDotPos=email.lastIndexOf(".");alert("lastDotPos: " + lastDotPos);var user=email.substr(0,atPos);alert("user: " + user);var domain=email.substr(atPos+1,lastDotPos-1); //<-- ISSUEfor(var i=atPos+1; i<lastDotPos; i++){ alert("email.charAt(" + i + "): " + email.charAt(i));}alert("domain: " + domain);var tld=email.substr(lastDotPos+1,email.length-1);alert("tld: " + tld);return false;} This is not fully functioning. Every time I run this, the domain always displays like gmail.com instead of gmail. I even tried to set the lastDotPos-1 to something I know that is suppose to give me gmail, but it still comes out as gmail.com. What is wrong?
  8. Oh okay. I didn't know mods could unlock accounts, but I am glad to know that. If mods can unlock accounts, I have no need for admins I forgot my password so I thought I try to guess it, but my account got locked before I got over 2 tries. They haven't been active since last year... there is no e-mail... I don't understand where you are coming from. I love the 3 active mods. They help me out a lot.
  9. What I meant was that there are only 3 active mods and on the forums, there are a total of 5 mods and 3 admins. What happen to the other 2 mods and 3 admins?
  10. Thanks for explaining this. Makes much more sense.
  11. There needs to be more active admins. It seems none of them are active. Only 3 mods are active and the rest disappeared. What happened? There needs to be a way for users to contact admins to unlock their account when it gets locked. Since the admins are not active, doesn't that mean it will never get unlocked?
  12. dalawh

    Float and Center

    When I used a form and input, text-align:center did not work, but when I changed it to just buttons, it worked fine. Oh okay. I tried the same method and it was off a bit. Won't be needing it now, so it doesn't matter.
  13. I am not missing a semi colon at the end. Not really sure where you are getting at.
  14. dalawh

    Float and Center

    Wouldn't that make it not centered? You said the left margin was approx 25px and the right margin is 10px. It seems if I don't use form and use buttons instead, the text-align:center works fine.
  15. It works. Can you explain to me why this is happening?
  16. I notice when I try to store html code in a variable and there is an ENTER between any code, the code does not work. Example: function displayRegister(){var a='<div></div>';} Code above is fine. function displayRegister(){var a='<div></div>';} Code above does not work. Is there a reason for this?
  17. dalawh

    Float and Center

    If you look at what they used, it is not centered. It is off to the right by a bit.
  18. Well, thanks for this. Guess I will stick with the 2 divs.
  19. dalawh

    Float and Center

    Is there any way to center floating elements? I tried using something similar to http://www.pmob.co.uk/pob/centred-float.htm, but it always came out a little uneven. I need something that is absolutely in the center.
  20. Thanks for the tabindex. If I only use that attribute for the 6 inputs, how will tab work outside that? Is there a better another way of aligning them without using div tags and put set distance between them or aligning them to an area?
  21. I have a form that looks like this. I currently have it set up using two div tags. The left side is one and the right side is another. If I have my cursor in the Email Address input and press TAB, it goes to Password input. I want to set it up where it looks exactly the same, but when I press TAB, it goes to Confirm Email Address input. Basically, I am wondering how I could align my page without using separate tags, so when I press TAB, it goes to the next one.
  22. It's a string. Yea, you were right. Thanks.
  23. Identical Comparison Operator: ===It compares the value and the type. I created a cookie and the value I used was 0. I compared it like this "if($_COOKIE['value']===0){ echo 'EQUAL';}". It seems to not be the same. Can anyone explain to me why? Aren't they both like integers?
  24. Okay, guess I will just have to redirect. 3 scripts and 2 redirects. Hope nothing gets more complicated than that.
  25. There is no HTML involved until the very end. I take you step by step. User fills out a form and presses submit. I use a PHP script to get that information and create a cookie and redirect it (using header) to another script. This new script will log everything.and redirect (using header) to the HTML stuff. Is that fine? Any idea if we can have two separate PHP scripts in one PHP file like...<?php//CODE?><?php//CODE?>
×
×
  • Create New...